use std::fs;
      
      let data = fs::read_to_string("/home/filename").expect("Impossible to read file");
      println!("{}", data);
      
      Rust language logo

      Read a file to String

      Codiga's Rust Recipes

      Read a local fila, store to a String and print the content

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.