Advertisements
Advertisements
Question
Which of the following functions is used to remove leading and trailing white spaces from the string?
Options
trim()
trail()
truncate()
slice()
MCQ
Solution
trim()
Explanation:
Many computer languages, including Java, employ the trim() function to eliminate leading and trailing white spaces from strings. It just removes the first and last spaces from the string.
shaalaa.com
Is there an error in this question or solution?