31
25

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.

stringからio.Readerへの変換したい

Posted at

testとかで使いたいと思ったタイミングがありました。

http://play.golang.org/p/QAiO7tmFY_

main.go
package main

import (
	"fmt"
	"strings"
)

func main() {

	r:=strings.NewReader("(1,2,34,55,666)")
	var d [5]int
	fmt.Fscanf(r,"(%d,%d,%d,%d,%d)",&d[0],&d[1],&d[2],&d[3],&d[4])
	fmt.Println(d)
}

31
25
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
31
25

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?