Answers for "how to read text files in rusr"

1

read file in rusr

use std::fs;

fn main() {
    
    let contents = fs::read_to_string(filename)
        .expect("Something went wrong reading the file");

    println!("With text:n{}", contents);
}
Posted by: Guest on September-15-2021

Browse Popular Code Answers by Language