日期:2014-05-20 浏览次数:20714 次
import java.io.*; class FileOperate { public static void main(String[] args) throws IOException { BufferedReader reader = new BufferedReader(new FileReader("filename")); String line; while((line=reader.readLine())!=null) if(line.contains("char")) System.out.println(line); } }