go string to rune array
package main
import "fmt"
func main() {
str := "Hello, 世界"
fmt.Println([]rune(str))
}
- Define a string variable
str
with the value "Hello, 世界". - Print the rune array representation of the string using
fmt.Println([]rune(str))
.