开发者

NSString get text between certain characters

开发者 https://www.devze.com 2023-01-04 08:46 出处:网络
If I have an NSString with something like开发者_如何学编程 this in it: Note Title Here:@:Note Description Here:@:123839:@:High Priority

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

精彩评论

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