diff --git a/src/references/strings.md b/src/references/strings.md index cfd3152df2c7..0900459c84e8 100644 --- a/src/references/strings.md +++ b/src/references/strings.md @@ -27,7 +27,7 @@ fn main() { s2.push_str(s1); println!("s2: {s2}"); - let s3: &str = &s2[s2.len() - s1.len()..]; + let s3: &str = &s2[2..9]; println!("s3: {s3}"); } ```