Converting integer to string - strconv, Itoa



examples/convert-string/convert_string.go
package main

import (
    "fmt"
    "strconv"
)

func main() {
    text := strconv.Itoa(42)
    fmt.Printf("%s\n", text) // 42
}

examples/convert-string/convert_string.out
42