From 3bfc9807bfedd0de7c703b80c64d017725beb3ba Mon Sep 17 00:00:00 2001 From: skiy Date: Wed, 21 Oct 2015 17:01:48 +0800 Subject: [PATCH] Update 04.6.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 勘误 --- eBook/04.6.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eBook/04.6.md b/eBook/04.6.md index bf7be68..61d7043 100644 --- a/eBook/04.6.md +++ b/eBook/04.6.md @@ -31,7 +31,7 @@ Go 支持以下 2 种形式的字面值: 字符串的内容(纯字节)可以通过标准索引法来获取,在中括号 `[]` 内写入索引,索引从 0 开始计数: - 字符串 str 的第 1 个字节:`str[0]` -- 第 i 个字节:`str[i]` +- 第 i 个字节:`str[i - 1]` - 最后 1 个字节:`str[len(str)-1]` 需要注意的是,这种转换方案只对纯 ASCII 码的字符串有效。