0% found this document useful (0 votes)
39 views

Strings Class Methods

This document discusses important methods of the Java String class, including toUpperCase(), toLowerCase(), length(), charAt(), replace(), concat(), equals(), and substring(). Examples are provided to demonstrate each method, such as converting a string to uppercase with toUpperCase() and extracting a substring with substring().

Uploaded by

Rohan
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
39 views

Strings Class Methods

This document discusses important methods of the Java String class, including toUpperCase(), toLowerCase(), length(), charAt(), replace(), concat(), equals(), and substring(). Examples are provided to demonstrate each method, such as converting a string to uppercase with toUpperCase() and extracting a substring with substring().

Uploaded by

Rohan
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 12

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 !!

You might also like