Skip to main content

title_case

Function title_case 

Source
pub fn title_case(s: String, word_separator: &str) -> String
Expand description

Interscript::Stdlib::Functions.title_case: gsub(/^(.)/, &:upcase) then gsub(/#{word_separator}(.)/, &:upcase) — the block upcases the WHOLE match (separator included), so the replacement for a match sep + ch is (sep + ch).to_uppercase.