Skip to content

Commit 7c861cf

Browse files
committed
additional docs example for replace **all** of str
1 parent be16c61 commit 7c861cf

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)