Read File In Rusr

[Solved] Read File In Rusr | Rust - Code Explorer | yomemimo.com
Question : read file in rusr

Answered by : bijay-poudel

use std::fs;
fn main() { let contents = fs::read_to_string(filename) .expect("Something went wrong reading the file"); println!("With text:\n{}", contents);
}

Source : | Last Update : Wed, 22 Sep 21

Answers related to read file in rusr

Code Explorer Popular Question For Rust