Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

int from string in go [duplicate]

Tags:

go

parseint

atoi

What's the function to create a int value from string

i := ???.????( "10" )
like image 293
OscarRyz Avatar asked Apr 20 '10 06:04

OscarRyz


1 Answers

Import the strconv package (src/pkg/strconv), then use strconv.Atoi("10")

like image 75
Kyle Rosendo Avatar answered Sep 28 '22 11:09

Kyle Rosendo