I want to assign string to bytes array:

var arr [20]byte
str := "abc"
for k, v := range []byte(str) {
  arr[k] = byte(v)
}

Have another method?

9 s
9

Tags:

Leave a Reply

Your email address will not be published. Required fields are marked *