Methods of String Class

Advertisement Remove all ads


The following String class methods are to be covered:
String trim()
String toLowerCase()
String toUpperCase( )
int length( )
char charAt (int n)
int indexOf(char ch)
int lastIndexOf(char ch)
String concat(String str)
boolean equals (String str)
boolean equalsIgnoreCase(String str)
int compareTo(String str)
int compareToIgnoreCase(String str)
String replace (char oldChar,char newChar)
String substring (int beginIndex)
String substring (int beginIndex, int endIndex)
boolean startsWith(String str)
boolean endsWith(String str)
String valueOf(all types)

Programs based on the above methods, extracting and modifying characters of a string, searching for a string using linear search technique.

If you would like to contribute notes or other learning material, please submit them using the button below.
Advertisement Remove all ads

View all notifications

      Forgot password?
View in app×