iOS 6中NSString新用法

来源:互联网 发布:东莞数控编程招聘信息 编辑:程序博客网 时间:2024/05/18 00:45
NSString *str = @"mobile developer tips";
 
// Convert string to uppercase
NSString *upperStr = [str uppercaseStringWithLocale:[NSLocale currentLocale]];
NSLog(@"upperStr: %@", upperStr);
 
// Convert string to caps
NSString *capStr = [upperStr capitalizedStringWithLocale:[NSLocale currentLocale]];
NSLog(@"capStr: %@", capStr);
 
// Convert string to lowercase
NSString *lowerStr = [capStr lowercaseStringWithLocale:[NSLocale currentLocale]];
NSLog(@"lowerStr: %@", lowerStr);
 
输出内容如下:
 
0 0
原创粉丝点击