additional docs example for replace **all** of str

This commit is contained in:
bvanjoi 2022-06-10 00:28:46 +08:00
parent be16c6166f
commit 7c861cf0ad

View File

@ -271,6 +271,7 @@ impl str {
/// let s = "this is old"; /// let s = "this is old";
/// ///
/// assert_eq!("this is new", s.replace("old", "new")); /// assert_eq!("this is new", s.replace("old", "new"));
/// assert_eq!("than an old", s.replace("is", "an"));
/// ``` /// ```
/// ///
/// When the pattern doesn't match: /// When the pattern doesn't match: