开发者

NSScanner to separate sentence into words (Objective C)

开发者 https://www.devze.com 2023-01-05 16:26 出处:网络
I have a string \"So: lets make some noise!\" and I would like it to be displayed one word at a time on the scree开发者_Python百科n. How can I go about this? NSScanners? I am new to objective C and re

I have a string "So: lets make some noise!" and I would like it to be displayed one word at a time on the scree开发者_Python百科n. 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 :)


Try this:

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

精彩评论

暂无评论...
验证码 换一张
取 消