adplus-dvertising
frame-decoration

Question

Which of these method of class String is used to remove leading and trailing whitespaces?

a.

startsWith()

b.

trim()

c.

Trim()

d.

doTrim()

Posted under Java Programming

Answer: (b).trim()

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. Which of these method of class String is used to remove leading and trailing whitespaces?