Go - Convert int to string
18 Oct 2022Go
An integer can be converted to string by Itoa
function which is in strconv
library.
Example :
import (
"fmt"
"reflect"
"strconv"
)
func main() {
nums1 := 10
fmt.Println(nums1, reflect.TypeOf(nums1))
str := strconv.Itoa(nums1)
fmt.Println(str, reflect.TypeOf(str))
}