How to split string into substrings on iOS?

后端 未结 3 481
闹比i
闹比i 2020-12-02 09:37

I received an NSString from the server. Now I want to split it into the substring which I need. How to split the string?

For example:

substrin

3条回答
  •  情深已故
    2020-12-02 10:08

    NSString has a few methods for this:

    [myString substringToIndex:index];
    [myString substringFromIndex:index];
    [myString substringWithRange:range];
    

    Check the documentation for NSString for more information.

提交回复
热议问题