//(2)创建一个空字符串
NSString *str1=[NSString new];
NSLog(@"str1=%@",str1);//打印出来是一个空字符: str1= ;
//给str1赋值
str1=@"This is a beautiful String!";
NSLog(@"str1=%@",str1);//打印结果:str1=林凤娇;
//(3)格式化创建字符串
int i=2;
int year = 2015;
int month = 10;
int day = 10;
float f1 = 3.14;
NSString *str2=[NSString stringWithFormat:@"--%d--%d--%d--%d--%.2f",i,year,month,day,f1];
NSLog(@"%@",str2);
//应用
//(1)两个字符串的连接
NSString *name1=@"This is a String!";
NSString *str3=[NSString stringWithFormat:@"She said:%@",name1];
NSLog(@"%@",str3);