5
4

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 5 years have passed since last update.

Golangのstrconvパッケージについて

Last updated at Posted at 2014-07-21

strconvパッケージは、文字列と基本データ型の双方向変換を実装している。

文字列を数値に変換する

よく使いそうなのは
func Atoi(s string) (i int, err os.Error)
だろう。
ParseInt(s, 10, 0)
の省略系でもある。


a, _ := strconv.Atoi("135")
fmt.Println(a) // => 135

b, _ := strconv.ParseInt("135", 10, 0)
fmt.Println(b) // => 135

Package strconv

内容薄すぎ。
追記予定です。

5
4
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
5
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?