Update 04.6.md

勘误
This commit is contained in:
skiy
2015-10-21 17:01:48 +08:00
parent b94d76ea77
commit 3bfc9807bf

View File

@@ -31,7 +31,7 @@ Go 支持以下 2 种形式的字面值:
字符串的内容(纯字节)可以通过标准索引法来获取,在中括号 `[]` 内写入索引,索引从 0 开始计数:
- 字符串 str 的第 1 个字节:`str[0]`
- 第 i 个字节:`str[i]`
- 第 i 个字节:`str[i - 1]`
- 最后 1 个字节:`str[len(str)-1]`
需要注意的是,这种转换方案只对纯 ASCII 码的字符串有效。