Skip to content

Commit 5751e72

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

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

library/alloc/src/str.rs

+1
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)