• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to remove whitespaces...  RSS feed

 
Barry Brashear
Ranch Hand
Posts: 303
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a need to remove whitespaces that fall an the end of a line. Is
there a good technique to do this?

Thanks.
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does the "trim()" method in java.lang.String do what you need? Otherwise, you might use a regular expression to match and remove whitespace just at the end of a String.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!