pub trait Casing {
Show 13 methods
// Required methods
fn to_normal_case(&self) -> String;
fn to_camel_case(&self) -> String;
fn to_pascal_case(&self) -> String;
fn to_snake_case(&self) -> String;
fn to_kebab_case(&self) -> String;
fn to_dot_case(&self) -> String;
fn to_path_case(&self) -> String;
fn to_windows_path_case(&self) -> String;
fn to_sentence_case(&self) -> String;
fn to_title_case(&self) -> String;
fn to_header_case(&self) -> String;
fn to_upper_snake_case(&self) -> String;
fn to_alternating_case(&self) -> String;
}Required Methods§
Sourcefn to_normal_case(&self) -> String
fn to_normal_case(&self) -> String
Returns a normal case version of the input text as a new String
§Example
use recase::Casing;
assert_eq!("Example String".to_normal_case(), "example string");Sourcefn to_camel_case(&self) -> String
fn to_camel_case(&self) -> String
Returns a camelCase version of the input text as a new String
§Example
use recase::Casing;
assert_eq!("Example String".to_camel_case(), "exampleString");Sourcefn to_pascal_case(&self) -> String
fn to_pascal_case(&self) -> String
Returns a PascalCase version of the input text as a new String
§Example
use recase::Casing;
assert_eq!("Example String".to_pascal_case(), "ExampleString");Sourcefn to_snake_case(&self) -> String
fn to_snake_case(&self) -> String
Returns a snake_case version of the input text as a new String
§Example
use recase::Casing;
assert_eq!("Example String".to_snake_case(), "example_string");Sourcefn to_kebab_case(&self) -> String
fn to_kebab_case(&self) -> String
Returns a kebab-case version of the input text as a new String
§Example
use recase::Casing;
assert_eq!("Example String".to_kebab_case(), "example-string");Sourcefn to_dot_case(&self) -> String
fn to_dot_case(&self) -> String
Returns a dot.case version of the input text as a new String
§Example
use recase::Casing;
assert_eq!("Example String".to_dot_case(), "example.string");Sourcefn to_path_case(&self) -> String
fn to_path_case(&self) -> String
Returns a path/case version of the input text as a new String
§Example
use recase::Casing;
assert_eq!("Example String".to_path_case(), "example/string");Sourcefn to_windows_path_case(&self) -> String
fn to_windows_path_case(&self) -> String
Returns a windows\path\case version of the input text as a new String
§Example
use recase::Casing;
assert_eq!("Example String".to_windows_path_case(), "example\\string");Sourcefn to_sentence_case(&self) -> String
fn to_sentence_case(&self) -> String
Returns a Sentence case version of the input text as a new String
§Example
use recase::Casing;
assert_eq!("Example String".to_sentence_case(), "Example string");Sourcefn to_title_case(&self) -> String
fn to_title_case(&self) -> String
Returns a Title Case version of the input text as a new String
§Example
use recase::Casing;
assert_eq!("Example String".to_title_case(), "Example String");Sourcefn to_header_case(&self) -> String
fn to_header_case(&self) -> String
Returns a Header-Case version of the input text as a new String
§Example
use recase::Casing;
assert_eq!("Example String".to_header_case(), "Example-String");Sourcefn to_upper_snake_case(&self) -> String
fn to_upper_snake_case(&self) -> String
Returns a UPPER_SNAKE_CASE version of the input text as a new String
§Example
use recase::Casing;
assert_eq!("Example String".to_upper_snake_case(), "EXAMPLE_STRING");Sourcefn to_alternating_case(&self) -> String
fn to_alternating_case(&self) -> String
Returns a AlTeRnAtInG cAsE version of the input text as a new String
§Example
use recase::Casing;
assert_eq!("Example String".to_alternating_case(), "eXaMpLe StRiNg");