Examveda
Examveda

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

Answer: Option D


This Question Belongs to Java Program >> Strings

Join The Discussion

Related Questions on Strings