Skip to main content

pascal_case

Function pascal_case 

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

Converts the specified text into Pascal Case.

§Arguments

  • text - the input text to convert

§Remarks

This function supports converting the following input forms:

  • Pascal Case (HelloWorld → HelloWorld)
  • Camel Case (helloWorld → HelloWorld)
  • Snake Case (hello_world → HelloWorld)
  • Screaming Snake Case (HELLO_WORLD → HelloWorld)
  • Kebab Case (hello-world → HelloWorld)
  • Screaming Kebab Case (HELLO-WORLD → HelloWorld)

The characters ' ', '_', and '-' are considered word boundaries. Alphabetic characters following these characters will be capitalized.

§Remarks

This function does not handle Unicode word boundaries.