A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
Refactoring for Software Design Smells: Managing Technical Debt
this week in the
OO, Patterns, UML and Refactoring
Java in General
which string function to remove whitespace between two strings
Joined: Feb 06, 2009
May 03, 2009 04:35:31
i want to remove spaces between 2 strings .
the trim function in
will remove only leading and trailing whitespaces.
but is there any string function in
such that the for example
str=" javahorn forum"
i want to remove the whitespace between javahorn and forum such that it displays as
Joined: Oct 13, 2005
May 03, 2009 04:47:43
Look for the replace and replaceAll methods. You may require an understanding of
Joined: Feb 21, 2007
May 03, 2009 23:44:49
Using regular expressions might help you in long term.
But for quick getting quick results without spending too much resources in writing good regexes you can alternatively try Apache string util api at
for several string processing functions.
I agree. Here's the link:
subject: which string function to remove whitespace between two strings
Removing specific character from the given String
Remove unwanted chars (new line,tab) in java
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015