Reputation: 4728
i have a NSString object named as myString.i need to append a space in each side of my string. can any one tell me the good way to do it?
Upvotes: 0
Views: 1214
Reputation: 3754
Then you can do it in this way.
NSString *s = [[NSString alloc]initWithFormat:@" %@ ",str];
Upvotes: 0
Reputation: 14063
NSString *myNewString = [NSString stringWithFormat: @" %@ ", myString];
Upvotes: 2