Created
June 5, 2017 03:05
-
-
Save tqcenglish/6a354c9abe8523165376a1a01676597e to your computer and use it in GitHub Desktop.
go语言string、int、int64互相转换
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#string到int | |
int,err:=strconv.Atoi(string) | |
#string到int64 | |
int64, err := strconv.ParseInt(string, 10, 64) | |
#int到string | |
string:=strconv.Itoa(int) | |
#int64到string | |
string:=strconv.FormatInt(int64,10) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment