Use the split() function in the path Pub package to split a path into its components.
import 'package:path/path.dart' as path; main() { print(path.split('/Users/shailen')); // Prints ['/', 'Users', 'shailen']. // Windows example. print(path .split(r'C:\tempdir\tmp.txt')); // Prints [r'C:\', 'tempdir', 'tmp.txt']) }
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://haodehen.cn/did129461