From 872c18fa425fae196baf23b179e8d8f9c12462c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=87=95=E7=9D=BF=E6=B6=9B?= Date: Sun, 17 Mar 2019 09:49:31 +0800 Subject: [PATCH] Update 18.1.md (#585) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit len([]int(str)) 修改为 len([]rune(str)) --- eBook/18.1.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eBook/18.1.md b/eBook/18.1.md index ae1cf9e..21b9a76 100644 --- a/eBook/18.1.md +++ b/eBook/18.1.md @@ -34,7 +34,7 @@ for ix, ch := range str { 最快速:`utf8.RuneCountInString(str)` - `len([]int(str))` + `len([]rune(str))` (5)如何连接字符串: @@ -59,4 +59,4 @@ for ix, ch := range str { - [目录](directory.md) - 上一节:[出于性能考虑的实用代码片段](18.0.md) -- 下一节:[数组和切片](18.2.md) \ No newline at end of file +- 下一节:[数组和切片](18.2.md)