Re: Empty and null strings
Re: Empty and null strings
- Subject: Re: Empty and null strings
- From: Arturo Perez <email@hidden>
- Date: Mon, 12 Sep 2005 14:13:05 -0400
Chuck Hill wrote:
On Sep 9, 2005, at 3:48 PM, Miguel Arroz wrote:
Hi!
This must be a "most asked" question, but here goes... I'm a little
confused with empty and null strings, in what relates to WOTextField
component.
Why does a WOTextField value is null when there is no text?
Shouldn't it be an empty string?
No, I think it should be null. The more interesting question is, "What
is the value if only a space is typed into the field.". In most cases,
I would want to treat this the same as null. IIRC, it is not null so
you have to handle this case specially (e.g. string.trim ().length() == 0).
So, to handle this properly, one must override every WOComponent's
takeValuesFromRequest() to do the above, correct? My interest lies more
along the lines of
string = string.trim();
-arturo
_______________________________________________
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