PDA

View Full Version : How to change a string to UPCASE or lowercase in xcode? thanks!




xingworld
Jan 26, 2011, 01:49 AM
How to change a string to UPCASE or lowercase in xcode? thanks!



dejo
Jan 26, 2011, 10:00 AM
Assuming you have an NSString, please read the class reference (http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Classes/NSString_Class/Reference/NSString.html) for it. There are two instance methods it has that are specifically built for what you're looking for.

P.S. And by "in Xcode", we have to assume you mean "using Objective-C". If not, you should let us know. Remember, accuracy is important, both in programming and getting help in a programming forum.

xingworld
Jan 27, 2011, 08:40 AM
Assuming you have an NSString, please read the class reference (http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Classes/NSString_Class/Reference/NSString.html) for it. There are two instance methods it has that are specifically built for what you're looking for.

P.S. And by "in Xcode", we have to assume you mean "using Objective-C". If not, you should let us know. Remember, accuracy is important, both in programming and getting help in a programming forum.

Thank you very much.
I'm sorry that I don't express my meaning accurately.
My meaning is converting a selected text to upcase or lowercase by some operation/command in Xcode IDE.
Because I have not find a way to convert selected text into upcase or lowercase in operation menu.

balamw
Jan 27, 2011, 09:02 AM
By default "lowercase word" and "uppercase word" are unbound in Preferences -> Key Bindings -> Text Key Bindings. Just create a new set and bind them to something.

B

xingworld
Jan 28, 2011, 09:19 AM
By default "lowercase word" and "uppercase word" are unbound in Preferences -> Key Bindings -> Text Key Bindings. Just create a new set and bind them to something.

B

Thank you, thank you very much. I find it and set it successfully.
:D