mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-04 11:07:46 +00:00
compiler,runtime: implement string to []rune conversion
Commit message by aykevl
This commit is contained in:
committed by
Ayke van Laethem
parent
fa5855bff5
commit
e9f6e51fc8
Vendored
+19
@@ -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()
|
||||
}
|
||||
Reference in New Issue
Block a user