★☆

★☆
posts - 0, comments - 0, trackbacks - 0, articles - 80
  BlogJava :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理

用StringReader从String对象中读数据

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();
  }
 }