componentsSeparatedByString:截取指定字符串;
转载自:http://www.189works.com/article-80848-1.html
例:
NSString *animals = @"dog#cat#pig";
//将#分隔的字符串转换成数组
NSArray *array = [animals componentsSeparatedByString:@"#"];
NSLog(@"animals:%@",array);
componentsSeparatedByString:截取指定字符串;
转载自:http://www.189works.com/article-80848-1.html
例:
NSString *animals = @"dog#cat#pig";
//将#分隔的字符串转换成数组
NSArray *array = [animals componentsSeparatedByString:@"#"];
NSLog(@"animals:%@",array);