Re: Can't remove extraneous spacing.
Re: Can't remove extraneous spacing.
- Subject: Re: Can't remove extraneous spacing.
- From: Art Isbell <email@hidden>
- Date: Tue, 27 Sep 2005 18:10:09 -1000
On Sep 27, 2005, at 3:43 PM, Eric Stewart wrote:
The problem I'm having is that somehow extra spaces between words are
making it into the database.
I'm using the following code to remove all extra spaces:
value = value.replaceAll("\\s+", " ");
But some how input is still making it into the database that is more
than 1 space between words.
Your Java should work although
value = value.replaceAll("\\s{2,}", " ");
would ignore single spaces unlike your code.
Where are you using the above statement? Are you certain that
it is being executed for every string being saved to the DB?
Aloha,
Art
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden