Function multirep::exchange

source ·
pub fn exchange(s: &str, a: &str, b: &str) -> String
Expand description

Exchanges two patterns in a string

use multirep::exchange;
assert_eq!("foo bar", exchange("bar foo", "foo", "bar"));