Function ruplacer::replace [−][src]
pub fn replace<'a>(input: &'a str, query: &Query) -> Option<Replacement<'a>>
Expand description
Execute a query on a line of input. If there was a match, return a Replacement
Example
use ruplacer::{Query, replace}; let input = "this is some old text"; let query = Query::substring("old", "new"); let replacement = replace(input, &query).unwrap(); let output = replacement.output(); assert_eq!(output, "this is some new text");