Gehen Sie String zum Byte -Array
b := []byte("ABC€")
s := string([]byte{65, 66, 67, 226, 130, 172})
Zealous Zebra
b := []byte("ABC€")
s := string([]byte{65, 66, 67, 226, 130, 172})
str:=string(data)
fmt.Print(str)
s := string([]byte{65, 66, 67, 226, 130, 172})
fmt.Println(s) // ABC€
package main
import (
"fmt"
)
func main() {
var s string = "Hello World"
sb := []byte(s)
fmt.Println(sb) // [72 101 108 108 111 32 87 111 114 108 100]
fmt.Println(string(sb)) // Hello World
}