How do you append a unichar
character to NSMutableString
?
unichar c = 'T';
NSMutableString *s = [NSMutableString stringWithString:@"MyString"];
// want s to become "MyStringT"
https://discussions.apple.com/thread/1679290 suggests:
[s appendString:[NSString stringWithCharacters:&c length:1]];
Looks too long / complicated...
Use [NSString appendFormat:], so for above:
[s appendFormat:@"%C", c];
Enjoy!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With