How to convert slice of runes (characters - ASCII code) to string in Go

1 Answer

0 votes
package main

import (
    "fmt"
)

func main() {
    slice := []byte{103, 111, 32, 97, 98, 99}

    s := string(slice)
    
    fmt.Println(s)
}



/*
run:

go abc

*/

 



answered Oct 17, 2020 by avibootz

Related questions

2 answers 216 views
1 answer 120 views
1 answer 203 views
1 answer 214 views
1 answer 172 views
...