Explain Some Commonly used String Methods

S2 = S1 . to lowercase:
Converts the string S1 to all lower case.
S2 = S1 to upper case:
Converts the string S1 to all upper
S2 = S1. Replace (‘x’, ‘y’);
Replace all appearances of x with y
S1.equals (S2)
Returns ‘true’ if S1 is equal to S2
S1.length (   )
Gives the length of S1
S1.char at (n)
Gives nth character of S1
S1. concat (S2)
Concatenates S1 and S2
S1.substring (n)
Gives substring starting from nth character
P. testing (  )
Creates a string representation of the object P
S1. Indexof (‘x’)
Gives the position of the first occurance of ‘x’ is the string S1
String.value of (variable)
Converts the parameter value to string representation

Related

Differences between String class and String Buffer class?

Differences between string class and string buffer class: String objects are immutable and string buffer objects are mutable. Methods to manipulate the data are not available in string class. th...

Write about Variable size arrays in Java?

Variable size array: Java treats multidimensional array as “arrays of arrays”. it is possible to declare a two–dimensional array as follows: int x[ ] =new int[3][ ]; x[0]=new...

Enumerated data type

Enumerated data type: We can use the enumerated type in java using the enum keyword. This keyword can be used similar to the static final constants. public enum day{Sunday, Mon...

Post a Comment

emo-but-icon
:noprob:
:smile:
:shy:
:trope:
:sneered:
:happy:
:escort:
:rapt:
:love:
:heart:
:angry:
:hate:
:sad:
:sigh:
:disappointed:
:cry:
:fear:
:surprise:
:unbelieve:
:shit:
:like:
:dislike:
:clap:
:cuff:
:fist:
:ok:
:file:
:link:
:place:
:contact:

item