可变字符串NSMutableString
时间:2014-04-30 00:54:21
收藏:0
阅读:331
NSMutableString *mutableStr = [[NSMutableString alloc] initWithFormat:@"蓝鸥科技有限公司"];
NSMutableString *mutableStr1 = [NSMutableString stringWithFormat:@"蓝鸥科技有限公司"];
//拼接字符串
[mutableStr appendString:@".txt"];
NSLog(@"%@", mutableStr);
//插入
[mutableStr1 insertString:@"3G" atIndex:2];
NSLog(@"%@", mutableStr1);
//删除
[mutableStr1 deleteCharactersInRange:NSMakeRange(2, 2)];
NSLog(@"%@", mutableStr1);
评论(0)