| Author |
using string replace
|
Ranadhir Nag
Ranch Hand
Joined: Mar 09, 2006
Posts: 138
|
|
I have a string which contains a indefinite/random spacing between words. ex. "IE Mozilla Apache Netscape" I want to convert into an even-spaced string - "IE Mozilla Apache Netscape" Can someone suggest a way to achieve this?
|
 |
Peter Chase
Ranch Hand
Joined: Oct 30, 2001
Posts: 1970
|
|
|
Create a regular expression to match any number of whitespace characters. Use String.replaceAll() to replace each occurrence of this with one space character. Job done.
|
Betty Rubble? Well, I would go with Betty... but I'd be thinking of Wilma.<br /> <br />#:^P
|
 |
 |
|
|
subject: using string replace
|
|
|