Function rufl::string::pascal_case

source ·
pub fn pascal_case(s: impl AsRef<str>) -> String
Expand description

Converts string to pascal case.

§Arguments

  • s - The string to convert.

§Returns

Returns the pascal cased string.

§Examples

use rufl::string;

assert_eq!("FooBar", string::pascal_case("Foo Bar"));

assert_eq!("FooBar", string::pascal_case("fooBar".to_string()));

assert_eq!("FooBar", string::pascal_case("__FOO_BAR__"));