Extract characters from NSString object

后端 未结 3 1808
独厮守ぢ
独厮守ぢ 2021-01-22 08:05

How to extract individual characters from a string object in Objective-C ?

Example:

NSString * fooString = [NSString stringWithFormat:@         


        
3条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-22 08:50

    NSString * fooString = @"FOOSTRING";
    NSMutableArray *list = [NSMutableArray array];
    for (int i=0; i

    NSLog output:

    (
                                                      F,
                                                      O,
                                                      O,
                                                      S,
                                                      T,
                                                      R,
                                                      I,
                                                      N,
                                                      G
                                                      )
    

提交回复
热议问题