golang 类型转换
2015-07-28 12:15
603 查看
仅作记录,以便以后用到时查看方便。
字符串与整形:
字符串与整形:
//string to 10进制int64 i,err := strconv.ParseInt(string, 10, 64) //int64 to string fmt.Sprintf("%d",int64)//我一般用这种方式 s := strconv.FormatInt(int64,10)//查找资料后得知这种方式比较正规 //string to int i, err := strconv.Atoi(string) //int to string s := strconv.Itoa(int)
相关文章推荐
- 基本的Logos语法
- GoogleApis 屏蔽
- HangOver
- 前向分步算法(forward stagewise algorithm)
- Golang网页下载示例
- 【Google】25匹马的角逐
- Django basic command
- hdu 4722 Good Numbers(数位dp)
- HDU 2092 整数解
- django 1.8 官方文档翻译: 3-6-1 中间件概览
- 谷歌注册多个与Google Play和 China相关域名
- Goldbach's Conjecture(哥德巴赫猜想)
- mongo安装副本集
- HDU 1512 Monkey King(左偏树+并查集)
- 在heroku上部署gost代理服务端
- chrome访问google的hosts文件设置,测试好用
- go语言常用函数:copy
- go语言常用函数:make
- go语言常用函数:cap
- Django实例--英文、数字与中文之间增加空格