mirror of
https://gitee.com/shikong-sk/golang-study
synced 2025-02-22 23:12:15 +08:00
docs: for...range 循环
This commit is contained in:
parent
d9c196dd86
commit
d31422ceb0
@ -40,4 +40,11 @@ func main() {
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
// for...range 循环
|
||||
s := "hello"
|
||||
|
||||
for i, c := range s {
|
||||
fmt.Printf("%d %c\n", i, c)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user