128
74

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

golang 文字列→数値、数値→文字列変換

Last updated at Posted at 2018-02-18
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"

128
74
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
128
74

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?