创建:
(注意他没有这种创建:NSMutableString *str = @"";// 因为相当于子类指针指向父类对象)
NSMutableString *str = [NSMutableString stringWithFormat:@""];
NSMutableString *str = [[NSMutableString alloc] initWithFormat:@""];
在该字符串后添加字符串
[str appendString:@""];// 返回的还是原字符串
删除指定位置字符串
NSMutableString *str = [[NSMutableString alloc] initWithFormat:@"abcde--"];
NSRange range = [str rangeOFString:@"bc"];
[str deleteCharactersInRange:range]; |
|