📜  dart 逐行读取文件 - 无论代码示例

📅  最后修改于: 2022-03-11 14:59:31.152000             🧑  作者: Mango

代码示例1
import 'dart:async';
import 'dart:io';
import 'dart:convert';

main() {
  var path = ...;
  new File(path)
    .openRead()
    .map(utf8.decode)
    .transform(new LineSplitter())
    .forEach((l) => print('line: $l'));
}