Rollup merge of #97921 - bvanjoi:docs-example-str-replace, r=Dylan-DPC
additional docs example for replace **all** of str
This commit is contained in:
commit
b2172b7a53
1 changed files with 1 additions and 0 deletions
|
@ -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:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue