Function voca_rs::manipulate::replace
source · Expand description
Replaces the matches of pattern
with replacement
.
Arguments
subject
- The string to verify.pattern
- The pattern which match is replaced. Only the first occurrence replaced.replacement
- The string which replacespattern
match.
Example
use voca_rs::*;
manipulate::replace("swan", "wa", "u");
// => "sun"
manipulate::replace("domestic duck", "d", "D");
// => "Domestic duck"
manipulate::replace("Café del Mar cafe\u{0301}", "é", "e");
// => "Cafe del Mar café"
use voca_rs::Voca;
"swan"._replace("wa", "u");
// => "sun"