Rust Simple Search And Replace Regex

[Solved] Rust Simple Search And Replace Regex | Rust - Code Explorer | yomemimo.com
Question : rust simple search and replace regex

Answered by : mackerel

use regex::Regex;
fn word_replace(str: &str) -> String { let re = Regex::new(r"word").unwrap(); re.replace_all(&str, "****").to_string()
}
// Find each instance of "word" in a string and replace with something else.

Source : | Last Update : Sat, 27 Feb 21

Answers related to rust simple search and replace regex

Code Explorer Popular Question For Rust