Read a File to String in Rust
Read an entire file into a String using std::fs::read_to_string.
Author:
chris
// Language: Rust
use std::fs;
fn main() -> std::io::Result<()> {
let contents = fs::read_to_string("data.txt")?;
println!("{contents}");
Ok(())
}