strconv实现了go中基本数据类型与string之间的转换. How to use in go go doc:https://godoc.org/strconv import "strconv" int ↔ string func Atoi(s string) (int, error) 将string类型的s转换为十进制int类型,同时会返回error. func Itoa(i int) string 将十进制i转换为string类型. // int ↔ string string
在实际开发过程中,C++string类使用起来有很多不方便的地方,笔者根据根据这些不足简单的扩展了这个类,如增加与数字之间的相互转化和格式化字符串.不足的地方望指正.读者也可以根据自己需求继续扩展. 头文件:exstring.h /* Author: wuqiang Email: debugroot@126.com Description:exstring is a subclass of basic_string.It is added some userful operations,suc