StringVariable | String to change casing of. |
From | Name of case to interpret passed value as having. |
To | Name of case returned value should have. |
Note that mashedcase can only be converted to and not from since there is loss of information as to where the words separate.
Note also, this command will not test to determine if the input value actually has the from casing specified. If the casing of the input value and the from parameter do not match then behavior is undefined. (It is expected that in a future version we will be able to automatically detect casing.)
Note that arguments of the form XxxVariable can take either a normal value or the name of a variable to read/write, prefixed by @. See About Using @ for details.
% ChangeCasing HelloWorld PascalCase mixedCase
helloWorld
% ChangeCasing {How Are You} {Title Case} {hyphenated-case}
how-are-you
% set MyString {snake_case}
% ChangeCasing @MyString snake_lower SNAKE_UPPER
SNAKE_CASE
% puts $MyString
SNAKE_CASE