Read whole file
📝 RustRead a file's entire contents into a String with std::fs::readtostring.
Rust
use std::fs; fn main() { let contents = fs::readtostring("example.txt").expect("Failed to read file"); println!("{}", contents);
}
Comments
No comments yet. Start the discussion.