V

Vinay • 28.75K Points
Instructor II

Q. What is the purpose of the trim() method of a String object in Java?

  • (A) To remove all spaces from the string
  • (B) To concatenate two strings
  • (C) To extract a substring from the string
  • (D) To remove leading and trailing whitespace
  • Correct Answer - Option(D)
  • Views: 48
  • Filed under category JAVA

No solution found for this question.
Add Solution and get +2 points.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.


Question analytics