Skip to main content

snake_case

Function snake_case 

Source
pub fn snake_case(name: &str) -> String
Expand description

Converts a FIX PascalCase name to a snake_case identifier.

Acronym runs stay together, with the last capital starting the next word when lowercase follows (ClOrdID -> cl_ord_id, MDEntryPx -> md_entry_px), and a lone s stays with the acronym it pluralises (NoPartyIDs -> no_party_ids). Digits attach to the preceding word (Nested2PartyID -> nested2_party_id).