Discuz! Board

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 3727|回复: 0

go语言string、int、int64互相转换

[复制链接]

337

主题

337

帖子

1679

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
1679
发表于 2018-5-5 17:33:49 | 显示全部楼层 |阅读模式
#string到int  
int,err:=strconv.Atoi(string)  
#string到int64  
int64, err := strconv.ParseInt(string, 10, 64)  
#int到string  
string:=strconv.Itoa(int)  
#int64到string  
string:=strconv.FormatInt(int64,10)
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|飞克网 ( 皖ICP备16023507号 )

GMT+8, 2024-3-29 00:36 , Processed in 0.216429 second(s), 21 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表