Seminar Topic
STRING CLASS METHODS() WITH EXAMPLE
String Class
String is a sequence of characters.
But in Java, string is an object that represents a
sequence of characters.
The String class is immutable.
The java.lang.String class provides a lot of built-in methods that
are used to manipulate string in Java.
By the help of these methods, we can perform operations on
String objects.
some important methods of String class.
toUpperCase() Method
The Java String toUpperCase() method converts given String into
uppercase letter .
Example:
toLowerCase() Method
The Java String toLowerCase() method converts given String into
lowercase letter .
Example:
Java String length() Method
The String class length() method returns length of the specified
String.
Example:
Java String charAt() Method
The String class charAt() method returns a character at specified
index.
Example:
Java String replace() Method
The String class replace() method replaces all occurrence of first
sequence of character with second sequence of character.
Example :
Java String Concat() Method
The Java String class concat() method combines specified string at the
end of this string. It returns a combined string. It is like appending
another string.
Example :
Java String equal() Method
The Java String class equals() method compares the two given strings
based on the content of the string. If any character is not matched, it
returns false. If all characters are matched, it returns true.
Example :
Java String substring() method
The Java String class substring() method returns a part of the string.
substring() method that extract a substring from the given string by
using the index values passed as an argument.
Example :
Thank You !!