Mention the purpose and syntax of trim() method.
2 Likes
The trim() method of the String class removes the leading and trailing spaces from a string. It does not remove the spaces present in between the string.Syntax:stringObject.trim()
stringObject.trim()
Answered By
Output of the following statement is …………… .
System.out.println("WONDERFUL".substring(3,4));
How do you create strings implicitly and explicitly?
Mention the purpose and syntax of length() method.
Mention the purpose and syntax of charAt() method.