Logo 
Search:

Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: Dylan Bouchard   on Aug 20 In Java Category.

  
Question Answered By: Vidos Fischer   on Aug 20

String <java.sun.com/.../String.html>

trim <java.sun.com/.../String.html#trim()> ()
Returns a copy of the string, with leading and trailing whitespace
omitted.





Example:



String str = "a e i o u";



System.out.println(str);

str = str.trim();

System.out.println(str);



Your outputs will be:



a e i o u

aeiou

Share: 

 

This Question has 5 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on .trim Or get search suggestion and latest updates.


Tagged: