//------------------------NSMutableString
1. 不可变字符串的字符串创建:
NSMutableString *str2 = [NSMutableString stringWithFormat:@"Jack"];
NSMutableString *str3 = [NSMutableString string];
2. 格式化拼接字符串:
NSMutableString *str = [NSMutableString string];
[str appendFormat:@"http://www.baidu.com/%d",100];
3. 删除一部分内容:
[str deleteCharactersInRange:NSMakeRange(3, 4)];
4. 插入一个字符串:
[str insertString:@"p://" atIndex:3];
5. 将某个字符串内容替换成指定内容:
[str replaceCharactersInRange:NSMakeRange(11, 5) withString:@"itcast"];
6. 字符串拼接:
[str appendString:@"xxxxx"]; |
|