美文网首页
iOS ---一些集成代码

iOS ---一些集成代码

作者: PlatonsDream | 来源:发表于2016-05-19 23:01 被阅读7次

//resultArray中的每个元素都是一个键值对,我们只需要将数组的每个元素用&符号拼接即可
NSString *resultString = [resultArray componentsJoinedByString:@"&"];
//字符串包含某字符
[self.phone rangeOfString:@"|"].location !=NSNotFound //包含

//通过特定字符将字符串切割成数组 componentsSeparatedByString
NSString *a = [[NSString alloc] initWithString : @"冬瓜,西瓜,火龙果,大头,小狗" ];
NSArray *b = [a componentsSeparatedByString:@","];
NSString *a3 = [b objectAtIndex:2];
NSLog(@"\n b的第三个东东是: %@", a3);

相关文章

网友评论

      本文标题:iOS ---一些集成代码

      本文链接:https://www.haomeiwen.com/subject/gzwgrttx.html