golang int to string format

The method of converting int to string in go language

Convert int to string:

string := strconv.Itoa(int)
//////////////////////////
string to int:
int, err := strconv.Atoi(string)
string to int64:
int64, err := strconv.ParseInt(string, 10, 64)
Convert int64 to string:
string := strconv. FormatInt(int64,10)

Leave a Reply

Your email address will not be published. Required fields are marked *

en_USEnglish