Function to_camel_case

Source
pub fn to_camel_case(string: &str) -> String
Expand description

Converts any case into camelCase.

ยงExample

let camel = "helloWorld".to_owned();
assert_eq!(to_camel_case("hello world"), camel);
assert_eq!(to_camel_case("HELLO WORLD"), camel);
assert_eq!(to_camel_case("Hello World"), camel);
assert_eq!(to_camel_case("helloWorld"), camel);
assert_eq!(to_camel_case("HelloWorld"), camel);
assert_eq!(to_camel_case("hello-world"), camel);
assert_eq!(to_camel_case("Hello-World"), camel);
assert_eq!(to_camel_case("hello_world"), camel);
assert_eq!(to_camel_case("HELLO_WORLD"), camel);