Home »
MCQs »
Java MCQs
The trim() method in Java used to ___
83. The trim() method in Java used to ___.
- Remove the given character
- Remove the values after the given index
- Remove leading and trailing spaces
- None of these
Answer: C) Remove leading and trailing spaces
Explanation:
The Java method trim() is a built-in function that eliminates leading and trailing spaces.