Computer Applications

The trim() method of the String class removes …………… .

  1. leading spaces only
  2. trailing spaces only
  3. spaces in between words
  4. leading and trailing spaces

Java String Handling

14 Likes

Answer

leading and trailing spaces

Reason — 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.

Answered By

10 Likes


Related Questions