I have printed some text using println!
and now I need to clear the terminal and write the new text instead of the old. How can I clear all the current text from terminal?
I have tried this code, but it only clears the current line and 1
is still in the output.
fn main() {
println!("1");
print!("2");
print!("\r");
}