*
The moose likes Beginning Java and the fly likes How to remove spaces from string Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "How to remove spaces from string" Watch "How to remove spaces from string" New topic
Author

How to remove spaces from string

rama ilango
Greenhorn

Joined: Dec 11, 2008
Posts: 24
for example
a=" 58 "

how to remove the spaces from the above string?
Swastik Dey
Rancher

Joined: Jan 08, 2009
Posts: 1474
    
    6

use trim() of String class.


Swastik
rama ilango
Greenhorn

Joined: Dec 11, 2008
Posts: 24
What is the linux command to trim the string?
Tom Johnson
Ranch Hand

Joined: May 11, 2005
Posts: 142
http://www.unix.com/shell-programming-scripting/20022-trim-whitespace.html


<a href="http://faq.javaranch.com/java/UseCodeTags" target="_blank" rel="nofollow">Use Code Tags!!</a>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to remove spaces from string