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);
输出内容如下: