Pete
Pete

Reputation: 11

NSScanner to separate sentence into words (Objective C)

I have a string "So: lets make some noise!" and I would like it to be displayed one word at a time on the screen. How can I go about this? NSScanners? I am new to objective C and really need some help... thank you!

for example. the first word i see is "So:" the second word i see is "Lets"...with the last word being "noise!" It must be case sensitive and only cut out spaces. I also need to be able to control the speed at which the words are displayed.

If you can help me I will be eternally grateful :)

Upvotes: 1

Views: 495

Answers (1)

user23743
user23743

Reputation:

Try this:

NSArray *myArray = [myString componentsSeparatedByString: @" "];

Upvotes: 4

Related Questions