标签:span 拼接 append int 方法 bsp val form 代码
(一)相互转换
1、字符转int
NSString *newString =@“xxx”; int intString = [newString intValue];
2、int转字符
NSString *stringInt = [NSString stringWithFormat:@"%d",intString];
3、字符转float
float floatString = [newString floatValue];
4、float转字符
NSString *stringFloat = [NSString stringWithFormat:@"%f",intString];
(二)字符串拼接
NSString* string; // 结果字符串 NSString* string1, string2; //已存在的字符串,需要将string1和string2连接起来 //方法1. string = [NSString initWithFormat:@"%@,%@", string1, string2 ]; //方法2. string = [string1 stringByAppendingString:string2]; //方法3 . string = [string stringByAppendingFormat:@"%@,%@",string1, string2];
标签:span 拼接 append int 方法 bsp val form 代码
原文地址:http://www.cnblogs.com/Asssjc/p/6092966.html