Using java.util.Scanner to process line-based strings or files
2011-02-22 14:31 RayLee 阅读(233) 评论(0) 编辑 收藏 举报Scanner scanner = new Scanner(file or string);
while (scanner.hasNextLine()) {
processLine(scanner.nextLine());
}
You can do more than that using Scanner. See details in Java API documentations.