Horje
golang byte to string Code Example
go string to byte array
b := []byte("ABC€")
s := string([]byte{65, 66, 67, 226, 130, 172})
golang byte to string
str:=string(data)
fmt.Print(str)
golang []byte to string
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
}




11

Related
unzip a file in google colab Code Example unzip a file in google colab Code Example
check string contains golang Code Example check string contains golang Code Example
golang convert string to float Code Example golang convert string to float Code Example
golang array syntax Code Example golang array syntax Code Example
golang map has key Code Example golang map has key Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
13