Macro remove_matches

Source
macro_rules! remove_matches {
    ( $string:expr; $( $pat:expr ),* ) => { ... };
}
Expand description

Replaces multiple str at once, avoiding intermediate allocations. It returns a new String containing the result. Values passed by value keep ownership.

ยงExamples

 
let s = "Ciao bello";
 
let s_removed = remove_matches!( s; "ia", "b" );
 
assert_eq!(s_removed, "Co ello");