Re: figuring out the length of a string
Re: figuring out the length of a string
- Subject: Re: figuring out the length of a string
- From: John Lombardo <email@hidden>
- Date: Fri, 25 Jun 2004 11:28:05 +0800
Hmm, kooky.
Normally I just say:
if ([mystring length])
{
// so, if the length is not zero...
}
On occasions if I've already been working with a string that might be
null, I may have to use something like:
if (![[myString description] isNotEqualToString:@"(null)"])
Have a little experiment with these and if you're still getting an
error you don't understand, post the error message that Xcode is
giving you.
Cheers,
john
On Thu, 24 Jun 2004 16:22:49 -0500, John Spicer <email@hidden> wrote:
>
>
I know it's a stupid question, and I'm embarased to ask, but I've been
>
going through the docs for an hour and can't find it.
>
>
I'm loading some data from a database via web services, some of the
>
fields are nulls. The string is set to a CFNull in that case.
>
>
I'd like to filter on this somehow and return a blank string instead.
>
>
I have found an example on apple's site that using the [mystring
>
length] == 0 to test for this, but xcode does not like this.
>
>
I've searched through lots of docs without luck. There is probably a
>
simple way to do this, but damn if I can find it!
>
_______________________________________________
>
cocoa-dev mailing list | email@hidden
>
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
>
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.