I'm trying to make a program that reads any word on the command line and prints it on a new line that's all, what I'm trying to do is something like this:
Some text: hello
But instead I get something like this:
Some text:
Hello
Since using print!
instead of println!
the phrase "some text" is not printed.
What's going on?
fn main() {
loop {
let mut linea = String::new();
print!("something:\t");
let ingreso = std::io::stdin().read_line(&mut linea).unwrap();
println!("{:?}",ingreso);
if linea == "exit".to_string(){
break;
}
}
}