View Source Transmogrify.Pascalcase (transmogrify v2.0.1)
Convert strings to PascalCase
Summary
Functions
Convert a string to camelCase
, usually when originally snake_case
, using
the following rules
Functions
Convert a string to camelCase
, usually when originally snake_case
, using
the following rules:
- first letter is always capitalized
- ascii alphabetic letters immediately following an underscore are capitalized
- underscores are removed
- existing case and other characters are preserved in all other cases
iex> convert("PASCALCASE")
"PASCALCASE"
iex> convert("_pascal___case__")
"PascalCase"
iex> convert("pascal_case")
"PascalCase"
iex> convert("pascal_case")
"PascalCase"
iex> convert("PascalCASE")
"PascalCASE"
iex> convert("Pascal_CASE")
"PascalCASE"
iex> convert("PascalCase")
"PascalCase"
iex> convert("pascal_9case")
"Pascal9case"
iex> convert(:pascal_9case)
"Pascal9case"