NSString* string; // 结果字符串
NSString* string1, string2; //已存在的字符串,需要将string1和string2连接起来
//方法1.
string = [NSString initWithFormat:@"%@,%@", string1, string2 ];
//方法2.
string = [string1 stringByAppendingString:string2];
//方法3 .
string = [string stringByAppendingFormat:@"%@,%@",string1, string2];
网友评论