aboutsummaryrefslogtreecommitdiffhomepage
path: root/testdata/string.go
blob: f0aecd07ee18b10dbfcaa4c78ffecb8d6fe0ca69 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package main

func testRangeString() {
	for i, c := range "abcü¢€𐍈°x" {
		println(i, c)
	}
}

func testStringToRunes() {
	var s = "abcü¢€𐍈°x"
	for i,c := range []rune(s) {
		println(i, c)
	}
}

func main() {
	testRangeString()
	testStringToRunes()
}