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
Mention the purpose and syntax of indexOf() method.
How do you create strings implicitly and explicitly?
Mention the purpose and syntax of length() method.
Mention the purpose and syntax of charAt() method.