This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
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: 1449
    
    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
 
Similar Threads
removing newline and tabs from a string
How to remove spaces
clearing white space
readonly field value change
remove white spaces