Macro rust_assembler::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");