NSString * myText = @"This is my really long text view";
NSUInterger textLenght = [myText length]; //NSLog 32
如何在所選長度位置插入任何文本。例如,長度爲10?cocoa-touch如何將字符串插入到字符串中的特定長度位置
我試過,但它不工作!
NSRange textRange = [myText rangeOfComposedCharacterSequenceAtIndex:10];
[myText stringByReplacingCharactersInRange:textRange withString:@"NEW"];
[NSString的問題]的可能重複(http://stackoverflow.com/questions/4551214/nsstring-question) – Caleb