loop2.goΒΆ

// loop2.go

// To run at the command line:
//    $ go run loop2.go

package main

import "fmt"

func main() {
    s := "apple sauce"
    for i, c := range s {
        fmt.Printf("s[%v] = '%c'\n", i, c)
    }
}