mr_kirbs
asked on
Removing spaces from a Java string
I have a simple java program reading a name of type string from the database.
If the string contains 2 spaces between the first name and the second name I want to remove one of these spaces. Example if the database contains the name David Jones (2 spaces between David and Jones) I want to return David Jones(only 1 spaces between David and Jones).
Seems simple but confusing me none the less??
Thanks in advance
If the string contains 2 spaces between the first name and the second name I want to remove one of these spaces. Example if the database contains the name David Jones (2 spaces between David and Jones) I want to return David Jones(only 1 spaces between David and Jones).
Seems simple but confusing me none the less??
Thanks in advance
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
.replaceAll(" ", " ");
Cheers