Skip to content

Commit b2172b7

Browse files
authored
Rollup merge of #97921 - bvanjoi:docs-example-str-replace, r=Dylan-DPC
additional docs example for replace **all** of str
2 parents ae2aa18 + 7c861cf commit b2172b7

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

library/alloc/src/str.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,7 @@ impl str {
271271
/// let s = "this is old";
272272
///
273273
/// assert_eq!("this is new", s.replace("old", "new"));
274+
/// assert_eq!("than an old", s.replace("is", "an"));
274275
/// ```
275276
///
276277
/// When the pattern doesn't match:

0 commit comments

Comments
 (0)