NAME
ChangeCasing — Change the casing from one kind to another.
SYNOPSIS
ChangeCasing StringVariable From To
DESCRIPTION
Return Value
String using the new casing.
Arguments
StringVariableString to change casing of.
FromName of case to interpret passed value as having.
ToName of case returned value should have.
More Info
The following forms of casing are supported:
- PascalCase
- mixedCase
- Title Case (space between)
- hyphenated-case
- HYPHENATED-CASE
- mashedcase
- MASHEDCASE
- phrase case
- PHRASE CASE
- snake_case
- SNAKE_CASE

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.


For information regarding exceptions / errors, see here.
EXAMPLES
% 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

SEE ALSO
string
KEYWORDS
conversion, string, transform