天天看点

Objective-C学习之NSString(字符串操作)

NSString常用创建初始化方法

NSString *string0 = @"string";

NSString *string1 = [NSString stringWithFormat:@"it is %@",@"string"];

char *c = "string";

NSString *string2 = [[NSString alloc] initWithCString:c encoding:nil];

const char *utf8 = "utf";

NSString *string3 = [NSString  stringWithUT