Golang -Zeichenfolge zu Bytes
hello := []byte("hello-world")
Friendly Fox
hello := []byte("hello-world")
b := []byte("ABC€")
s := string([]byte{65, 66, 67, 226, 130, 172})
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
}