//字符串指定范围替换
NSString *str14 = [str13 stringByReplacingCharactersInRange:NSMakeRange(0, 2) withString:@"dan"];
NSLog(@"str14 = %@" , str14);
NSString *str14 = [str13 stringByReplacingCharactersInRange:NSMakeRange(0, 2) withString:@"dan"];
NSLog(@"str14 = %@" , str14);
2015-11-07
判断字符串是否相同
[str isEqualToString]
比较字符串
NSComparisonResult
按指定字符分割字符串
[str componentsSeparatedByString]
按照范围截取字符串
NSMakeRange
1.从某一位开始
[str substringFromIndex]
2.从开头
[str substringToIndex]
拆分字符串
for
[str characterAtIndex]
查找指定字符串位置
[str rangeOfString]
替换
[str stringByReplacingCharactersInRange]
[str isEqualToString]
比较字符串
NSComparisonResult
按指定字符分割字符串
[str componentsSeparatedByString]
按照范围截取字符串
NSMakeRange
1.从某一位开始
[str substringFromIndex]
2.从开头
[str substringToIndex]
拆分字符串
for
[str characterAtIndex]
查找指定字符串位置
[str rangeOfString]
替换
[str stringByReplacingCharactersInRange]
2015-10-28
字符串类型转换
1.c->oc : [NSString stringWithUTF8String]
2.oc->c : [str UTF8String]
格式化字符串
[NSString stringWithFormat]
拼接字符串
[str stringByAppendingString]
大小写转换
1.[str lowercaseString]
2.[str UppercaseString]
判断前后缀
1.[str hasPrefix]
2.[str hasSuffix]
1.c->oc : [NSString stringWithUTF8String]
2.oc->c : [str UTF8String]
格式化字符串
[NSString stringWithFormat]
拼接字符串
[str stringByAppendingString]
大小写转换
1.[str lowercaseString]
2.[str UppercaseString]
判断前后缀
1.[str hasPrefix]
2.[str hasSuffix]
2015-10-28
//枚举器
NSEnumerator *enumerator;
enumerator = [array1 objectEnumerator];
id thing;
while (thing = [enumerator nextObject]) {
NSLog(@"%@",thing);
}
NSEnumerator *enumerator;
enumerator = [array1 objectEnumerator];
id thing;
while (thing = [enumerator nextObject]) {
NSLog(@"%@",thing);
}
2015-09-10