Function cruet::case::table::to_table_case

source ·
pub fn to_table_case(non_table_case_string: &str) -> String
Expand description

Converts a &str to table-case String

use cruet::case::table::to_table_case;

assert_eq!(to_table_case("foo-bar"), "foo_bars");
assert_eq!(to_table_case("FOO_BAR"), "foo_bars");
assert_eq!(to_table_case("foo_bar"), "foo_bars");
assert_eq!(to_table_case("Foo Bar"), "foo_bars");
assert_eq!(to_table_case("Foo bar"), "foo_bars");
assert_eq!(to_table_case("FooBar"), "foo_bars");
assert_eq!(to_table_case("fooBar"), "foo_bars");