Filed under: Developer, iPhone, SDK, iPod touch
CSStringTokenizer, a Cocoa Touch front end for tokenizing strings
Have you ever wanted to work with rather deep elements of Core Foundation in the iPhone SDK with some sort of front end? August Joki has just come up with a project that provides a Cocoa Touch wrapper for the CFStringTokenizer type in the Core Foundation framework.As you can see in the screen shot at right, the demo provides various aspects about the current string including the string in a letter, word, or using a WordBoundary. It works just like CFStringTokenizer can, but can be accessed using this front-end.
If you're wondering what CFStringTokenizer actually is, it's useful for breaking a string into a token, which can specified by words, sentences, or paragraphs. You're also able to further modify the tokenization once you break it down.
This is something that's going to be useful for iPhone developers who like to work with a Cocoa Touch interface to bring lower-level elements of the iPhone OS into their apps, and also to developers who work with natural language strings.
To download this project, go over to the cocoa-stringtokenizer project page on GitHub.


![TUAW [Cafepress]](http://www.blogsmithmedia.com/www.tuaw.com/media/tuaw-cafepress-promo.png)


Reader Comments (Page 1 of 1)
Rafe H. said 9:42AM on 10-27-2009
Why yes, Huang, that would be a challenging paragraph to tokenize!
Reply
betafrog said 10:36AM on 10-27-2009
I believe you've misspelled the title of the article.. No?
Reply
rob said 10:38AM on 10-27-2009
Thought I'd mention that for simple cases NSString's "componentsSeparatedByString:" method should suffice:
http://developer.apple.com/mac/library/DOCUMENTATION/Cocoa/Reference/Foundation/Classes/NSString_Class/Reference/NSString.html#//apple_ref/occ/instm/NSString/componentsSeparatedByString:
Reply
Dave said 10:41AM on 10-27-2009
For serious parsing needs, ParseKit (http://www.parsekit.com/) is a wonderful alternative.
Reply
macxprt said 2:56PM on 10-27-2009
I thought we were past the days of assigning or referring things as "tokens". Sigh... we still have a long way to go, Dr. King.
Reply