pascal_case

Function pascal_case 

Source
pub fn pascal_case(str_input: &str) -> String
Expand description

Converts a string to PascalCase.

Splits the input string into words based on spaces, hyphens, and underscores, then capitalizes the first letter of each word and joins them together.

§Arguments

  • str_input - The input string to convert

§Returns

  • String - The converted string in PascalCase

§Examples

use lowdash::pascal_case;

assert_eq!(pascal_case("hello world"), "HelloWorld");
assert_eq!(pascal_case("foo-bar"), "FooBar");
assert_eq!(pascal_case("lorem_ipsum"), "LoremIpsum");