import
import("strconv")
#文字列→数値変換
型変換
var i int
var s string="123"
i, _ = strconv.Atoi(s)
fmt.Println(i) // -> 123
#数値→文字列変換
型変換
var i int=321
var s string
s = strconv.Itoa(i)
fmt.Println(s) // -> "321"
Go to list of users who liked
More than 3 years have passed since last update.
import("strconv")
#文字列→数値変換
var i int
var s string="123"
i, _ = strconv.Atoi(s)
fmt.Println(i) // -> 123
#数値→文字列変換
var i int=321
var s string
s = strconv.Itoa(i)
fmt.Println(s) // -> "321"
Register as a new user and use Qiita more conveniently
Go to list of users who liked