You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

27 lines
496 B

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 testRunesToString(r []rune) {
println("string from runes:", string(r))
}
type myString string
func main() {
testRangeString()
testStringToRunes()
testRunesToString([]rune{97, 98, 99, 252, 162, 8364, 66376, 176, 120})
var _ = len([]byte(myString("foobar"))) // issue 1246
}