Update 18.1.md (#585)

len([]int(str)) 修改为 len([]rune(str))
This commit is contained in:
燕睿涛
2019-03-17 09:49:31 +08:00
committed by 无闻
parent 84a4014136
commit 872c18fa42

View File

@@ -34,7 +34,7 @@ for ix, ch := range str {
最快速:`utf8.RuneCountInString(str)` 最快速:`utf8.RuneCountInString(str)`
`len([]int(str))` `len([]rune(str))`
5如何连接字符串 5如何连接字符串
@@ -59,4 +59,4 @@ for ix, ch := range str {
- [目录](directory.md) - [目录](directory.md)
- 上一节:[出于性能考虑的实用代码片段](18.0.md) - 上一节:[出于性能考虑的实用代码片段](18.0.md)
- 下一节:[数组和切片](18.2.md) - 下一节:[数组和切片](18.2.md)