Multiple choice

The______________ returns a copy of the invoking string from which any leading and trailing whitespace has been removed.

  1. length() method

  2. trim() method

  3. charAt() method

  4. none of these

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

 The 'trim()' method returns a copy of the invoking string from which any leading and trailing whitespace has been removed.