IOS changes the case sensitivity of letters, and iOS letters
Use lowercaseString and uppercaseString
- (void)test{ NSString *testString = @"Hello World"; // lower case NSString *lowerCaseString1 = [testString lowercaseString]; NSString *lowerCaseString2 = testString.lowercaseString; // upper case NSString *upperCaseString1 = [lowerCaseString1 uppercaseString]; NSString *upperCaseString2 = lowerCaseString1.uppercaseString; NSLog(@"lowerCaseString1: %@",lowerCaseString1); NSLog(@"lowerCaseString2: %@",lowerCaseString2); NSLog(@"upperCaseString1: %@",upperCaseString1); NSLog(@"upperCaseString2: %@",upperCaseString2); // capitalize the first word of the sentence NSString *txt = @"hi my friends!"; txt = [txt stringByReplacingCharactersInRange:NSMakeRange(0,1) withString:[[txt substringToIndex:1] uppercaseString]]; NSLog(@"txt: %@", txt);}
Print result:
2014-08-26 17:00:30.266 MyApp[68821:60b] lowerCaseString1: hello world2014-08-26 17:00:30.267 MyApp[68821:60b] lowerCaseString2: hello world2014-08-26 17:00:30.267 MyApp[68821:60b] upperCaseString1: HELLO WORLD2014-08-26 17:00:30.267 MyApp[68821:60b] upperCaseString2: HELLO WORLD2014-08-26 17:00:30.268 MyApp[68821:60b] txt: Hi my friends!
Reference Source:
Http://stackoverflow.com/questions/8693741/converting-all-text-to-lower-case-in-objective-c
Http://stackoverflow.com/questions/2432452/how-to-capitalize-the-first-word-of-the-sentence-in-objective-c
How can I change uppercase and lowercase letters in EXCEL?
Assume that column A is the original content and input = UPPER (A1) in B1)
Press enter, select B1, move the cursor to the lower right corner, and double-click the "+" icon ".
This is in upper case and LOWER case = LOWER (A1)
What is the difference between IOS and iOS in Case sensitivity?
I pad my Padi watch my watch I phone my mobile Phone I OS (I phone OS) my mobile Phone's operating system because OS, the operating system is generally capitalized, therefore, iOS has a certain trademark meaning. In fact, writing IOS and ios is exactly the same (if you think that the WTO and wto, Windows and win, if there is no difference in Win), some people will be a bit like being fooled to sell Amway after buying Apple .. To say that the product is not perfect or wrong, there is a kind of pathological trial, just ignore this kind of person.