NSString *str = @"easy tips for programming";
// Convert string to uppercase
NSString *upperStr = [str uppercaseStringWithLocale:[NSLocale currentLocale]];
NSLog(@"Upper Case: %@", upperStr);
// Convert string to caps
NSString *capStr = [upperStr capitalizedStringWithLocale:[NSLocale currentLocale]];
NSLog(@"Capital: %@", capStr);
// Convert string to lowercase
NSString *lowerStr = [capStr lowercaseStringWithLocale:[NSLocale currentLocale]];
NSLog(@"Lower Case: %@", lowerStr);
output:
Upper Case: EASY TIPS FOR PROGRAMMING
Capital: Easy Tips For Programming
lower Case: easy tips for programming
No comments:
Post a Comment