I am a bit new to Objective C and was wondering if there is a better way to count words in a string.
ie:
NSString *str = @"this is a string";
// return should be 4 words ..
The way I now how to do it is by breaking the string into an array of words space (' ') character and count the array.
Any advise will be appreciated! Thanks!! :)
EDIT: For those of you who came here looking for answer; I found a similar post with an excellent reply.
http://stackoverflow.com/questions/2266434/how-to-count-words-within-a-text-string