Re: Can't remove extraneous spacing.
Re: Can't remove extraneous spacing.
- Subject: Re: Can't remove extraneous spacing.
- From: LD <email@hidden>
- Date: Wed, 28 Sep 2005 18:33:49 +1000
Hi there,
On 28/09/2005, at 2:23 PM, Eric Stewart wrote:
I figured out the problem but it's turned up something I don't
understand.
I'm getting the input from the request like this:
String value = context().request().stringFormValueForKey
("input_field");
When someone enters the html entity for a non-breaking space it
is not collapsed with the replaceall() I was using, which makes
[sense].
[...]
Also, how do I convert all the incoming non-breaking spaces to normal
spaces which will collapse with the replaceall() method?
String value = context().request().stringFormValueForKey
( "input_field" );
value = value.replaceAll( "(\\Q \\E|\\s)+", " " ).trim();
e.g.,
" abc bb " --> "abc bb"
with regards,
--
LD
_______________________________________________
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