aliensbrain
  • Home
  • Study
  • Quizzes
  • 🎤AI Practicefree
  • Notebooks
  • Community
  • Sign in
  • Core Java-2
  • Which method of the String class is used to remove the le...
Multiple choice

Which method of the String class is used to remove the leading and trailing blank spaces from the string?

  1. insert()

  2. delete()

  3. replace()

  4. trim()

  5. charAt()

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

trim() method is used to remove the blank spaces from both the ends of the invoking string.

Keep practicing — related questions

  • which function is used to clear leading or trailing spaces or infact any other characters?
  • Which of the following methods in java returns a copy of the invoking string from which any leading and tra...
  • The______________ returns a copy of the invoking string from which any leading and trailing whitespace has ...
  • Which function strips the leading and trailing blanks of a string?
  • Which of the following methods is used in Java to concatenate two strings?
  • Which of the following methods in StringBuffer class is used to replace one set of characters with another ...
  • For string Variables,when we set the format to "Trim Blanks" what happens?
  • If we want to convert all the characters in a String object into a character array, we use the _________ me...
Play the full quiz 🎤 Practise this topic out loud

Practice this topic

  • Java Core Classes and Threads (1473 questions)
Advertisement
© Aliensbrain | all rights reserved
  • About
  • Contact
  • Terms and Condition
  • Privacy Policy