Skip to main content

camel_to_snake_string

Function camel_to_snake_string 

Source
pub fn camel_to_snake_string(s: &str) -> String
Expand description

Converts ASCII camel-case text into an owned lowercase snake-case string.

An underscore is inserted before an uppercase byte only when the preceding byte is not uppercase; leading and consecutive capitals remain joined. Input is processed bytewise, so non-ASCII UTF-8 text is not preserved.