mirror of
https://github.com/SourceFellows/gobuch.git
synced 2025-08-02 21:02:15 +02:00
initial import
This commit is contained in:
19
golang-language-samples/for-range/main.go
Normal file
19
golang-language-samples/for-range/main.go
Normal file
@ -0,0 +1,19 @@
|
||||
package main
|
||||
|
||||
import "fmt"
|
||||
|
||||
func main() {
|
||||
|
||||
text := "Hello"
|
||||
|
||||
//Nur Zuweisung des Index
|
||||
for v := range text {
|
||||
fmt.Print(v)
|
||||
}
|
||||
|
||||
//Zuweisung von Index und Wert
|
||||
for i, v := range text {
|
||||
fmt.Printf("index %d value %c\n", i, v)
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user