Explain Some Commonly used String Methods
https://www.computersprofessor.com/2016/05/explain-some-commonly-used-string.html?m=0
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
|