From 2220a451c965ce3d65e0f992dfa0db52ff3df7a3 Mon Sep 17 00:00:00 2001 From: ZiJiaW Date: Sat, 8 Jan 2022 16:23:04 +0800 Subject: [PATCH] Update string-slice.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 最后一个字节是4~ --- book/contents/basic/compound-type/string-slice.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/book/contents/basic/compound-type/string-slice.md b/book/contents/basic/compound-type/string-slice.md index ac03833e..a427dc8b 100644 --- a/book/contents/basic/compound-type/string-slice.md +++ b/book/contents/basic/compound-type/string-slice.md @@ -67,8 +67,8 @@ let s = String::from("hello"); let len = s.len(); -let slice = &s[3..len]; -let slice = &s[3..]; +let slice = &s[4..len]; +let slice = &s[4..]; ``` 你也可以截取完整的`String`切片: