#import <Foundation/Foundation.h>
int main(int argc, const char * argv[]) {
@autoreleasepool {
NSString *[email protected]"pear",*[email protected]"apple";
NSString *newstr=[[NSString alloc]initWithFormat:@"拼接后%@ %@",str1,str2];
NSString *newstr1=[str1 stringByAppendingString:str2];
NSString *newstr2=[str1 stringByAppendingFormat:@"-%@",str2];
NSLog(@"%@",newstr2);
}
return 0;
}
时间: 2024-11-03 21:53:38