title: How to ignore the line break while printing a string read from stdin?
body: <p>I tried to write a bit of code which reads a name from stdin and prints it. The problem is the line breaks immediately after printing the variable and the characters following the variable are printed in the next line:</p>
  
  <pre><code>use std::io;
  
  fn main() {
      println!("Enter your name:");
      let mut name = String::new();
      io::stdin().read_line(&amp;mut name).expect("Failed To read Input");
      println!("Hello '{}'!", name);
  }
  </code></pre>
  
  <p>The '!' is printed in the next line, which is not the expected location.</p>
  
  <p><a href="https://i.stack.imgur.com/dr94U.png" rel="noreferrer"><img src="https://i.stack.imgur.com/dr94U.png" alt="enter image description here"></a></p>