Re: parsing a string into words
Re: parsing a string into words
- Subject: Re: parsing a string into words
- From: Alastair Houghton <email@hidden>
- Date: Sun, 26 Apr 2009 15:01:23 +0100
On 26 Apr 2009, at 04:33, Jeffrey Oleander wrote:
NSArray * tokens = [string componentsSeparatedByCharactersInSet:
whitespaceCharacterSet];
No, no, no. If you read Gerriet's original post, you would have
noticed that he even explained that what you just said won't work,
because not all languages use whitespace to separate words like
English does.
You probably want to be using CFStringTokenizer(), at least on OS X.
For cross-platform code, ICU is probably your best bet.
Kind regards,
Alastiar.
--
http://alastairs-place.net
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden