github.com/gnolang/gno@v0.0.0-20240520182011-228e9d0192ce/gnovm/tests/files/for17.gno (about) 1 package main 2 3 func main() { 4 for i, chr := range "thisisastring" { 5 println(i, string(chr)) 6 } 7 } 8 9 // Output: 10 // 0 t 11 // 1 h 12 // 2 i 13 // 3 s 14 // 4 i 15 // 5 s 16 // 6 a 17 // 7 s 18 // 8 t 19 // 9 r 20 // 10 i 21 // 11 n 22 // 12 g