Methods of String Class

Advertisement Remove all ads

Topics

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
Share
Notifications

View all notifications


      Forgot password?
View in app×