Quick actions

cmd+k|ctrl+k

Navigation

Languages

range statement / range over a string / Essential Go

Snippet info

Language

Go

Visibility

public

Author

kkowalczyk

Created

2019-03-11T07:00:21Z

Updated

2019-03-11T07:00:21Z

package main

import "fmt"

func main() {
	s := "Hey 世界"
	for idx := range s {
		b := s[idx]
		fmt.Printf("idx: %d, byte: %d\n", idx, b)
	}
}
INFO