Thursday, May 5, 2011

How to concatenate char / string on iPhone?

NSString *string = [NSString stringWithFormat:@"%@ %@", @"Hello", @"World"];
NSLog(@"%@", string);

or

NSString *string1 = @”Hello”;
NSString *string2 = @”World”;

string1 = [string1 stringByAppendingString:string2];

No comments:

Post a Comment