Created
May 29, 2018 06:10
-
-
Save irshadhasmat/5c163bd4237ff9021a711a62c02814e4 to your computer and use it in GitHub Desktop.
GoLang : Int & Int64 to String Conversion
This file contains hidden or 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
package main | |
import ( | |
"fmt" | |
"strconv" | |
) | |
func main() { | |
var i int = 12345 | |
var i64 int64 = 12345 | |
// Conversion of Int to String | |
strInt := strconv.Itoa(i) | |
fmt.Println(strInt) | |
// Conversion of Int64 to String | |
strInt64 := strconv.FormatInt(i64, 10) | |
fmt.Println(strInt64) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment