inflections::case

Function is_train_case

Source
pub fn is_train_case(string: &str) -> bool
Expand description

Check to see if a string is Train-Case.

ยงExample

assert_eq!(is_train_case("Hello-World"), true);
assert_eq!(is_train_case("hello world"), false);
assert_eq!(is_train_case("HELLO WORLD"), false);
assert_eq!(is_train_case("Hello World"), false);
assert_eq!(is_train_case("helloWorld"), false);
assert_eq!(is_train_case("HelloWorld"), false);
assert_eq!(is_train_case("hello-world"), false);
assert_eq!(is_train_case("hello_world"), false);
assert_eq!(is_train_case("HELLO_WORLD"), false);