IOS : NSString retrieving a substring from a string

后端 未结 2 1603
广开言路
广开言路 2021-02-05 08:39

Hey I am looking for a way to extract a string from another string. It could be any length and be in any part of the string so the usual methods don\'t work.

For exampl

2条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-02-05 08:56

    Try this

    NSArray* foo = [@"10/04/2011" componentsSeparatedByString: @"/"];

    NSString* day = [foo objectAtIndex: 0];

提交回复
热议问题