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:
Dylan DPC 2022-06-12 12:14:26 +02:00 committed by GitHub
commit b2172b7a53
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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: