title: Rust: print out string character by character
body: <p>The task it to print the text of the string to the terminal, character by character, using Rust.</p>
  
  <p>Here is my code:</p>
  
  <pre class="lang-rust prettyprint-override"><code>use std::time::Duration;
  use std::thread::sleep;
  
  fn main() {
      let string = "You are the Semicolon to my Statements.";
  
      for c in string.chars() {
          print!("{}", c);
          sleep(Duration::from_millis(100));
      }
  
      println!();
  }
  </code></pre>
  
  <p>When running my code, the string only prints to the terminal after the loop is completed.</p>
  
  <p>How can I print the string character by character?</p>
  
  <p>P.S. Here is a working example in Python 3:</p>
  
  <pre class="lang-py prettyprint-override"><code>import time
  
  string = "You are the Semicolon to my Statements."
  
  for i in string:
      print(i, end='', flush=True)
      time.sleep(0.1)
  
  print()
  </code></pre>