2010-09-18 94 views

回答

12
NSString *newString = [@"foo" stringByAppendingString:@"bar"]; 

經常考慮使用它的可變變體 - NSMutableString,它允許在不創建新實例的情況下追加字符串:

NSMutableString *mutString = [NSMutableString stringWithString:@"foo"]; 
[mutString appendString:@"bar"];