开发者

How to retrieve part of the NSString * from NSString *

开发者 https://www.devze.com 2023-01-07 10:10 出处:网络
I want to ask an NSString * question. I have a NSString * object. Th开发者_如何学Ce content is like the following example. (like the CSV file)

I want to ask an NSString * question. I have a NSString * object. Th开发者_如何学Ce content is like the following example. (like the CSV file)

Example: (my file is longer than this one so much)

First Name,Last Name,Middle Name,Phone,Chan,Tim,Man,123-456-789,Tom,,,987-654-321

(if it is empty, no space between the ',')

How can I use the objective C to storage different value by the NSArray * or NSMutableArray *? Thank you very much.


you can NSArray* arr = [aString componentsSeparatedByString:@","]


Use This Code :

NSArray* arrCountryName = (NSArray *)[yourString componentsSeparatedByString: @","];
0

精彩评论

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