0% found this document useful (0 votes)
2 views2 pages

Java String Methods Explained

The document provides a detailed overview of various string methods in Java, including their outputs and functionalities. Key methods discussed include length, equals, charAt, indexOf, contains, toUpperCase, toLowerCase, startsWith, endsWith, replace, substring, and subsequence. Each method is explained with its expected output format and examples.

Uploaded by

K.Ramesh Babu
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views2 pages

Java String Methods Explained

The document provides a detailed overview of various string methods in Java, including their outputs and functionalities. Key methods discussed include length, equals, charAt, indexOf, contains, toUpperCase, toLowerCase, startsWith, endsWith, replace, substring, and subsequence. Each method is explained with its expected output format and examples.

Uploaded by

K.Ramesh Babu
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

STRING

Statement: String s = “Welcome To Java”;

1. [Link]
It gives the length (int) of the string ( no. of each letter & includes
space).
{15}

2. [Link]
It gives output in Boolean format. (we have to type the entire
given values, as it is written in the statement).
{true}
3. [Link]
It gives output in Boolean format. (we have to type the entire
given values, without considering the cases).
{false}
4. [Link] (5)
It gives out put in char format. ( we have to give the index
number and it gives the O/P for the particular index value[letter] ).
{m}
5. [Link] (m)
It gives out put in int format. ( we have to give the particular
index value[letter] and it gives the O/P for the particular index value
[number] ).
{5}
6. [Link](“T”)
It gives output in boolean format. ( we can give single or group of
letters as it is written in statement).
7. [Link]
It gives output in capital letters for all the given values in the
statement.
8. [Link]
It gives output in small letters for all the given values in the
statement.
9. [Link]
It gives out in Boolean format. ( we have to give the initial values
as written in the statement, with respect to case sensitive).
10. [Link]
It gives out in Boolean format. ( we have to give the final values
as written in the statement, with respect to case sensitive).
11. [Link]
It gives output after replacing the old [char] with the new [char].
( we have to select the “char old char, char new char”).
12. [Link]
It gives output after replacing the old values [word] with the new
values[word]. (we have to select the “char sequence target, char
sequence replacement”).
13. [Link]
It gives output after removing the values present before the given
index values.
14. [Link]
It gives output after removing the values present before & after the
given index values.

You might also like