Expand description
Utilities to change the case of a string to another case. Supports “lower case,” “UPPER CASE,” “sentence case,” “Title Case,” “camelCase,” “PascalCase,” “kebab-case,” “Train-Case,” “snake_case,” and “CONSTANT_CASE.”
For more information Wikipedia has an interesting article on these special case styles.
§Example
use inflections::case::to_camel_case;
assert_eq!(to_camel_case("Hello World"), "helloWorld".to_owned());Functions§
- is_
camel_ case - Check to see if a string is camelCase.
- is_
constant_ case - Check to see if a string is CONSTANT_CASE.
- is_
kebab_ case - Check to see if a string is kebab-case.
- is_
lower_ case - Check to see if a string is completely lower case.
- is_
pascal_ case - Check to see if a string is PascalCase.
- is_
sentence_ case - Check to see if a string is sentence case.
- is_
snake_ case - Check to see if a string is snake_case.
- is_
title_ case - Check to see if a string is Title Case.
- is_
train_ case - Check to see if a string is Train-Case.
- is_
upper_ case - Check to see if a string is completely UPPER CASE.
- to_
camel_ case - Converts any case into camelCase.
- to_
constant_ case - Converts any case into CONSTANT_CASE.
- to_
kebab_ case - Converts any case into kebab-case.
- to_
lower_ case - Converts any case into lower case ignoring separators.
- to_
pascal_ case - Converts any case into PascalCase.
- to_
sentence_ case - Converts any case into traditional sentence case without capitalizing the first letter.
- to_
snake_ case - Converts any case into snake_case.
- to_
title_ case - Converts any case into title case where every word is capitalized.
- to_
train_ case - Converts any case into Train-Case.
- to_
upper_ case - Converts any case into UPPER CASE ignoring separators.