NSMutableString:
1.字符串拼接
[mStr appendString:@"亂我心者"];
2.插入
[mStr insertString:@"滾蛋吧!腫瘤君" atIndex:4];atIndex表示插入的位置
3.刪除
[mStr deleteCharactersInRange:NSMakeRange(5, 7)]; 5表示刪除的位置,7表示刪除多少個字符
NSMutableArray:
1.獲取元素個數count 例:array.count
2.用下表獲取對象:[array objectAtIndex:3] 獲取下標爲3的數
3.插入元素
[mArray inserObject:@"大俠" atIndex:2];
4.刪除元素
[mArray removeObjectAtIndex:3]
5.替換元素
[mArray replaceObjectAtIndex:2 withObject:@"蘋果"]
6.交換元素
[mArray exchangeObjectAtIndex:0 withObjectAtIndex:2]