stringWithFormat 知道答案了,不知道准不准确.还请大神给予指点
#import <Foundation/Foundation.h>
int main(int argc, const char * argv[]) {
char *name2 = "dsdfj";//不能插入中文
NSString *name1 = @"awvvv"; int age = 12; NSString *name = @"dl我是sdkfls";//OC对象可以插入中文
NSString * str = [NSString stringWithFormat:@"%@ %d %s %@",name1, age,name2,name]; NSLog(@"%@", str);
}
-----------------------------------------------------
2016-09-27 23:14:37.045 nsstring1[2664:63842] awvvv 12 dsdfj dl我是sdkfls Program ended with exit code: 0
|