Skip to main content

replace_all_words

Function replace_all_words 

Source
pub fn replace_all_words(text: &str, old: &str, new_word: &str) -> String
Expand description

Replace all whole-word occurrences of old in text with new_word. Returns the original string unchanged if no occurrences are found.