mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 01:04:03 +00:00
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
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user