compiler,runtime: implement string to []rune conversion

Commit message by aykevl
This commit is contained in:
scriptonist
2019-06-11 21:56:28 +05:30
committed by Ayke van Laethem
parent fa5855bff5
commit e9f6e51fc8
4 changed files with 35 additions and 1 deletions
+19
View File
@@ -0,0 +1,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()
}