View Full Version : textField Question: prefix + capitalized variable

03-02-2010, 10:50 PM
Hello, I was just wondering if there was a way to add a prefix to an incoming variable and have that variable be capitalized as to not upset the naming convention. Say it looks something like this:

textField -e -text ("right"+$selAttr[0])

and the incoming variable is "translateX". Is there a way to get "rightTranslateX" with the translate capitalized?

03-03-2010, 08:12 AM

Not sure if this is the sort of thing you want.

window myWin;
columnLayout myCol;
textField -text "foo" myTextField;
showWindow myWin;

string $sel[] = `ls -sl`;
textField -e -text ("right"+capitalizeString($sel[0])) myTextField;


03-03-2010, 02:51 PM
Excellent!!! :D ty ty ty

CGTalk Moderation
03-03-2010, 02:51 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.