Questions tagged «int64»

2
Golang将字符串转换为int64
我想将字符串转换为int64。我从strconv包装中发现的是Atoi功能。似乎将字符串转换为int并返回它: // Atoi is shorthand for ParseInt(s, 10, 0). func Atoi(s string) (i int, err error) { i64, err := ParseInt(s, 10, 0) return int(i64), err } ParseInt实际上返回一个int64: func ParseInt(s string, base int, bitSize int) (i int64, err error){ //... } 因此,如果我想从字符串中获取int64,应该避免使用Atoi,而是使用ParseInt吗?还是在某处隐藏了Atio64?
74 string  go  int64 
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.