Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR RUST

read file contents in rust

use std::fs;

fn main() {
    let data = fs::read_to_string("file_name.txt").expect("Unable to read file");
    println!("{}", data);
}
 
PREVIOUS NEXT
Tagged: #read #file #contents #rust
ADD COMMENT
Topic
Name
7+6 =