Answers for "golang byte to string umlaute"

Go
4

golang byte to string

str:=string(data)
fmt.Print(str)
Posted by: Guest on September-02-2020
0

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
}
Posted by: Guest on December-29-2021

Browse Popular Code Answers by Language