mirror of
https://github.com/unknwon/the-way-to-go_ZH_CN.git
synced 2025-11-13 17:36:12 +08:00
修改部分描述,添加必要的标点符号,补充代码超链接 (#804)
This commit is contained in:
@@ -15,7 +15,7 @@ s2:= string(c) // s2 == "cello"
|
||||
substr := str[n:m]
|
||||
```
|
||||
|
||||
(3)如何使用`for`或者`for-range`遍历一个字符串:
|
||||
(3)如何使用 `for` 或者 `for-range` 遍历一个字符串:
|
||||
|
||||
```go
|
||||
// gives only the bytes:
|
||||
@@ -43,7 +43,7 @@ for ix, ch := range str {
|
||||
|
||||
`Strings.Join()`(参考[章节4.7](04.7.md))
|
||||
|
||||
使用`+=`:
|
||||
使用 `+=`:
|
||||
|
||||
```go
|
||||
str1 := "Hello "
|
||||
@@ -51,7 +51,7 @@ for ix, ch := range str {
|
||||
str1 += str2 //str1 == "Hello World!"
|
||||
```
|
||||
|
||||
(6)如何解析命令行参数:使用`os`或者`flag`包
|
||||
(6)如何解析命令行参数:使用 `os` 或者 `flag` 包
|
||||
|
||||
(参考[例12.4](examples/chapter_12/fileinput.go))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user