mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-03 10:37:46 +00:00
compiler,runtime: implement []rune to string conversion
This is used by a few packages in the standard library, at least compress/gzip and regexp/syntax.
This commit is contained in:
committed by
Ron Evans
parent
fea56d4164
commit
fd3309afa8
Vendored
+6
-1
@@ -8,12 +8,17 @@ func testRangeString() {
|
||||
|
||||
func testStringToRunes() {
|
||||
var s = "abcü¢€𐍈°x"
|
||||
for i,c := range []rune(s) {
|
||||
for i, c := range []rune(s) {
|
||||
println(i, c)
|
||||
}
|
||||
}
|
||||
|
||||
func testRunesToString(r []rune) {
|
||||
println("string from runes:", string(r))
|
||||
}
|
||||
|
||||
func main() {
|
||||
testRangeString()
|
||||
testStringToRunes()
|
||||
testRunesToString([]rune{97, 98, 99, 252, 162, 8364, 66376, 176, 120})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user