字符串处理
duyiwuer2009
这个作者很懒,什么都没留下…
展开
-
读入字符串,遇到某一字符结束读入
/** * 读入字符串,遇到某一字符结束读入 * int.txt: 中国123美国abc日本;123 */import java.io.*;class Test{ public static void main(String[] args) throws IOException { FileReader in = new FileReader("in.txt"); int原创 2012-05-15 16:36:02 · 3378 阅读 · 0 评论 -
C/C++ 字符串与数字相互转化方法小结
1. 字符串 --> 数字ato: atoi(), atol(), atoll(), atof()strto: strtol(), strtoul(), strtod()strto 是 ato 的升级版:(1) strto 支持转化成多种进制(2) ato 对错误情况的处理很不完善, strto 对完善了错误处理2. 数字 --> 字符串(1) sprint原创 2014-04-08 10:16:51 · 3043 阅读 · 0 评论