JZTXT
  • 首页
  • Ai
  • Java
  • Python
  • Android
  • Mysql
  • JavaScript
  • Html
  • CSS

rust读取txt

发布时间 2023-04-19 13:12:39作者: CrossPython
use std::fs::File;
use std::io::{BufRead, BufReader};

fn main() {
    let file = File::open("f.txt").expect("File not found");
    let reader = BufReader::new(file);
    for line in reader.lines() {
        println!("{}", line.unwrap());
    }
}

  

    本栏目推荐文章
  • 学习 Rust 的 15 种方法
  • 批量修改文件名-txt_word_ppt批量修改文件名
  • Rust 从入门到摔门而出门 环境安装 和 Hello, world!
  • Rust 使用包、Crate 和模块管理不断增长的项目
  • 40. 干货系列从零用Rust编写负载均衡及代理,websocket的实现
  • 网站优化之robots.txt
  • Vue3中实现world、excel、txt、pdf文件预览,(vue-office的使用)
  • 在mac上转换txt文件编码方式
  • Rust 枚举和模式匹配
  • rust angular 自签名证书 wss
版权声明:本网站为非赢利性站点,本网站所有内容均来源于互联网相关站点自动搜索采集信息,相关链接已经注明来源。
联系我们