[−][src]Function display_utils::replace
pub fn replace<'a>(
source: &'a str,
from: &'a str,
to: &'a str
) -> impl Display + 'a
Replace instances of the from
string with the to
string.
Note: this function, contrary to its std equivalent
str::replace
,
does not support the Pattern API because that API is not yet stabilized.
assert_eq!(replace("this is old", "old", "new").to_string(), "this is new");