ICSE Class 10 Computer Applications
Question 2 of 46
String Handling — Question 2
Back to all questions 2
Question Question 2(i)
Mention the purpose and syntax of trim() method.
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()