//一般的字符串的解析
NSString *string = @"One,Two,Three,Four";
NSLog(@"string:%@",string);
NSArray *array = [string componentsSeparatedByString:@","];
NSLog(@"array:%@",array);
//两个json数组连在一起的解析
NSString *jsonStringOther=[NSString stringWithFormat:@"{\"name\":\"李华\", \"sex\":\"女\", \"age\":\"20\" }\n{\"name\":\"李华\", \"sex\":\"女\", \"age\":\"20\" }"];
NSLog(@"-----jsonStringOther---%@",jsonStringOther);
NSArray *jsonArray = [jsonStringOther componentsSeparatedByString:@"\n"];
NSLog(@"jsonArray:%@",jsonArray);
字符串的分割
时间: 2024-10-13 12:31:30