• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Empty and null strings
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
  • Follow-Ups:
    • Re: Empty and null strings
      • From: Chuck Hill <email@hidden>
References: 
 >Empty and null strings (From: Miguel Arroz <email@hidden>)
 >Re: Empty and null strings (From: Chuck Hill <email@hidden>)

  • Prev by Date: Re: Apple, any slight update or estimation on WO 5.3.1, Please ??
  • Next by Date: Re: Empty and null strings
  • Previous by thread: Re: Empty and null strings
  • Next by thread: Re: Empty and null strings
  • Index(es):
    • Date
    • Thread