Reputation: 55604
How do I concenate 2 strings in objective-c, like in VB.net you can just do "foo" & "bar"
Upvotes: 1
Views: 673
Reputation: 170849
NSString *newString = [@"foo" stringByAppendingString:@"bar"];
If you're going to change your string frequently consider using its mutable variant - NSMutableString
which allows to append strings without creating new instance:
NSMutableString *mutString = [NSMutableString stringWithString:@"foo"];
[mutString appendString:@"bar"];
Upvotes: 12