Discuz! Board

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 3915|回复: 0
打印 上一主题 下一主题

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

[复制链接]

336

主题

339

帖子

1699

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
1699
跳转到指定楼层
楼主
发表于 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-4-29 01:16 , Processed in 0.201734 second(s), 20 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

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