Golang strconv.Itoa() function example
package strconv
Golang strconv.Itoa() function usage example.
package main
import (
"fmt"
"strconv"
)
func main() {
age := 12
// will NOT display properly
fmt.Println(string(age))
// convert int to string
agestr := strconv.Itoa(age)
// will display properly now
fmt.Println(agestr)
}
Reference :
Advertisement
Something interesting
Tutorials
+11.3k Golang : Characters limiter example
+14.4k Golang : How to pass map to html template and access the map's elements
+13.1k Golang : How to get a user home directory path?
+20.7k Golang : Saving private and public key to files
+12.3k Golang : 2 dimensional array example
+6.8k Android Studio : Hello World example
+12.1k Golang : convert(cast) string to integer value
+8.3k Golang : Check if integer is power of four example
+11.6k Swift : Convert (cast) Float to String
+9.3k Golang : How to get username from email address
+10.3k Golang : Detect number of faces or vehicles in a photo
+33.6k Golang : How to check if slice or array is empty?