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

1 Answer

0 votes
package main

import (
    "fmt"
)

func main() {
    s := "go abc"

    slice := []rune(s)

    fmt.Println(slice)
}



/*
run:

[103 111 32 97 98 99]

*/

 



answered Oct 17, 2020 by avibootz

Related questions

1 answer 211 views
1 answer 177 views
2 answers 177 views
2 answers 108 views
1 answer 154 views
...