golang byte to string
str:=string(data)
fmt.Print(str)
golang byte to string
str:=string(data)
fmt.Print(str)
golang
s := string([]byte{65, 66, 67, 226, 130, 172})
fmt.Println(s) // ABC€
golang convert string to bytes and convert bytes to string
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
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us