Posted on 2008-08-13 13:00
☆ 阅读(151)
评论(0) 编辑 收藏 所属分类:
J2SM
用StringReader从String对象中读数据:
用StringReader从String对象中读数据
String str="saddsa 1231 asdgad 78987";
StringReader cin = new StringReader(str);
int c;
try {
while((c=cin.read())!=-1)
{
System.out.print((char)c);
}
} catch (IOException e) {
e.printStackTrace();
}
}