Multiple choice

Which of the following methods in java returns a copy of the invoking string from which any leading and trailing whitespace has been removed?

  1. replace()

  2. concat()

  3. trim()

  4. substring()

  5. setLength()

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

This method in java returns a copy of the invoking string from which any leading and trailing whitespace has been removed.