Re: Empty and null strings
Re: Empty and null strings
- Subject: Re: Empty and null strings
- From: Chuck Hill <email@hidden>
- Date: Mon, 12 Sep 2005 09:13:54 -0700
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).
The empty string and null objects are two distinct things for the
model, right?
Yes. And empty string is a value, null indicates the total absence
of any value.
Chuck
--
Practical WebObjects - a book for intermediate WebObjects developers
who want to increase their overall knowledge of WebObjects, or those
who are trying to solve specific application development problems.
http://www.global-village.net/products/practical_webobjects
_______________________________________________
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