2009-07-07 23 views

回答

18

這並不難......

NSMutableString *a = [NSMutableString stringWithString:@"aString"]; 
NSRange range; 
range.location = 0; 
range.length = 1; 
[a deleteCharactersInRange:range]; 

可以縮短範圍創造這樣的:

NSRange range = {0,1}; // edit: of course 0,1 instead of 1,0, thanks Omar 
+0

感謝您的幫助。它的工作,但我必須指出,要刪除第一個字符,它將是: NSRange範圍= {0,1}; 不是 NSRange範圍= {1,0}; – Omar 2009-07-07 11:16:26