Browsing Category
Java
Description of Java is a general-purpose programming language that is class-based, object-oriented, and designed to have as few implementation dependencies as possible. Java is a general-purpose programming language that is class-based, object-
Java String substring() Function Example
A substring of a string is defined as a sequence of characters in the string starting at some index and going continuously (without skipping any index or changing the order of characters) up to some higher index. The right index of the…
Java String isEmpty() Function Example
A situation that arises while solving many algorithmic problems or while development is determining when a String is empty, i.e., has size 0. To determine this, the String class (Java.lang.String), since the issue of JDK 1.6, has an…
Java String lastIndexOf() Function Example
Java String lastIndexOf() is an inbuilt method that is used to find out the index of the last occurrence of a character or the starting index of the last occurrence of a substring in a given String. This method comes in four variations:…
Java String startsWith() Function Example Tutorial
Java string startsWith() is an inbuilt method of String class that is used for checking the prefix of the String. The startsWith() method can either start checking from the first index or can start checking from a specified index. It…
Java String split() Function Example
Java String split() is an inbuilt method introduced in JDK 1.4 which splits the String wherever it encounters a given regex and returns the split up parts in the form of an array. The string split() method breaks a given string around…
Java String join() Method Example Tutorial
Java String join() is an inbuilt method that is used to join character sequences with a specific delimiter. The delimiter is added between each different character sequence to combine all the character sequences into a single String. If you…
Java String intern() Method Example Tutorial
Java String intern() is an inbuilt method that returns native method of th String class. This means that this method is implemented in native coding using the Java Native Interface(JNI). The JNI specification governs the rules and…
Java String replace Example | String replace() Function In Java
Java string replace method returns the string replacing all the old char or CharSequence to a new char or CharSequence. At times, it is required to replace some characters in a String with a new character. It might also be required to…
Java String replaceAll Example | replaceAll() In Java
Java String replaceAll is an inbuilt function that returns the string after it replaces each substring of that matches a given regular expression with a given replacement. Sometimes, it is required to replace more than just one character or…
Java String Format Example | String Format In Java
Java String format() is an inbuilt method that is used to return formatted strings using given locale, format, and arguments. If you don’t specify the locale in the String format() method, by default, it uses the Locale.getDefault() method.…
Java String getBytes() Example | Java getBytes() Function
Java String getByte() is an inbuilt method that helps us to encode a given string into a sequence of byte code and returns an array of bytes. It encodes the String into a sequence of bytes using the specified charset and returns the array…