开发者

NSString get text between certain characters

If I have an NSString with something like开发者_如何学编程 this in it: Note Title Here:@:Note Description Here:@:123839:@:High Priority How can I separate out the strings between the ":@:" characters? I would know how many segments to expect if using something other than an array/for-loop would be easier.

Thanks!


Take at look at the componentsSeparatedByString: method. It should do what you want

[myString componentsSeparatedByString: @":@:"]

should give you an NSArray instance containing the parts of the string split out

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜