Skip to content

Commit

Permalink
additional docs example for replace **all** of str
Browse files Browse the repository at this point in the history
  • Loading branch information
bvanjoi committed Jun 9, 2022
1 parent be16c61 commit 7c861cf
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions library/alloc/src/str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@ impl str {
/// let s = "this is old";
///
/// assert_eq!("this is new", s.replace("old", "new"));
/// assert_eq!("than an old", s.replace("is", "an"));
/// ```
///
/// When the pattern doesn't match:
Expand Down

0 comments on commit 7c861cf

Please sign in to comment.