Go: Convert string to byte slice (array)

When you convert a string to a byte slice, you get a slice that contains the bytes of the string:

fmt.Println([]byte("abc日")) // [97 98 99 230 151 165]

Comments

Be the first to comment!