String endsWith example

String endsWith is used to check if a String ends with the given suffix.

endsWith() method returns a boolean value based on the suffix passed String endsWith exampl

Read More →

String startsWith example

String startsWith method is used to check if a String starts with a specified substring. Startswith method has 2 variations and we will see both these.

[crayon-6483

Read More →

String replace methods example

String replace methods are used to replace a part of string with a new string. We have 4 variations for replace in String

String replace(char oldChar, char newChar) returns

Read More →

String lastIndexOf example

String lastIndexOf returns the index of the last occurrence of the given String for specified conditions searching backward. String lastIndexOf method can be used with multiple types of parameters

Read More →

String indexOf example

String indexOf returns the index of the given String for specified conditions. String indexOf method can be used with multiple types of parameters as shown below

1.

Read More →

String toUpperCase example

String toUpperCase method is used to converts all characters in a given string to upper case. String has 2 toUpperCase methods.

The first method takes a default Loc

Read More →

String toLowerCase example

String toLowerCase method is used to converts all characters in a given string to lower case. String has 2 toLowerCase methods.

The first method takes a default Loc

Read More →

String substring example

String substring method is used to get a part of String using the start and end index. String had 2 substring methods.

1. String substring(int beginIndex) returns

Read More →

String length example

String length method in java is used to get the length of a given string. String length method example

Output Please Note: Before p

Read More →

String equals and equalsIgnoreCase

String equals and equalsIgnoreCase are used for comparing 2 Strings in java.Both these methods works exactly similar except for equalsIgnoreCase compares String ignoring case consideration. example

Read More →