pub fn write(filename: String, text: String) -> Result<()>Expand description
Writes to a file with PRTGN encoding.
ยงExamples
let filename = "test.prtgn".to_string();
let text = "Hello world! This is some example text.".to_string();
write(filename, text).unwrap();Examples found in repository?
More examples
examples/read_write.rs (line 7)
3fn main() {
4 let filename = "test.prtgn".to_string();
5 let text = "Hello world! This is some example text.".to_string();
6
7 write(filename, text).unwrap();
8
9 let filename = "test.prtgn".to_string();
10
11 let read_text = read(filename).unwrap().to_string();
12
13 println!("{}", read_text)
14}