NSString searching for zero
NSString searching for zero
- Subject: NSString searching for zero
- From: Claudius Sailer <email@hidden>
- Date: Sun, 22 Sep 2002 13:48:09 +0200
Hi,
I have a NSString which includes only four time 'zero' (It comes from a
CString). How can I check whether this NSString has for 'zero' or not?
This doesn't work:
if ([[text stringByTrimmingCharactersInSet:[NSCharacterSet
whitespaceCharacterSet]] length] == 0)
and this seems a little bit stupid:
if (([text characterAtIndex:0] == 0) && ([text characterAtIndex:1] ==
0) && ([text characterAtIndex:2] == 0) && ([text characterAtIndex:3] ==
0))
bye
Claudius
_______________________________________________
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.