Golang convertit la corde en tranche de rune

Golang program that converts string to rune slice

package main

import "fmt"

func main() {
    // An example string.
    value := "cat"
    fmt.Println(value)

    // Convert string into a slice of runes.
    slice := []rune(value)
    fmt.Println(slice)

    // Convert rune slice into a string.
    original := string(slice)
    fmt.Println(original)
}

Output

cat
[99 97 116]
cat
Grumpy Giraffe