赞
踩
1.创建对象
(1)便利构造器(+号方法)
NSString *str1 = [NSString stringWithFormat:@"iphone%d",5];存储字符串@"lanou"的地址
NSUInteger length = [str1 length];
5.查找指定字符串的范围
NSRange range = [str4 rangeOfString:@"www"];}
6.字符串截取(获取字符串)
(1) 获取字符串给定下表之后的子串,包含指定下标的对应的字符
7.字符串拼接
NSString *str1 = [NSString stringWithFormat:@"lanou"];
8 替换字符串
NSString *str2 = [NSString stringWithFormat:@"lanohca牛逼shd"];
9.字符串比较.(重点)
NSComparisonResult result = [@"111" compare:@"222"];
10.字符串和数值类型转换
(1)@"123"转换为 123Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。