title: Removing spaces from a variable input using PowerShell 4.0
body: <p>I've tried a few things already but they don't seem to work for some reason. </p>
  
  <p>Basically what I'm attempting to do is have a user input a value using the 
  "Read-host" cmdlet, then strip it of any spaces.</p>
  
  <p>I tried:</p>
  
  <pre><code>$answer = read-host
  $answer.replace(' ' , '""')
  </code></pre>
  
  <p>And:</p>
  
  <pre><code>$answer = read-host
  $answer -replace (' ')
  </code></pre>
  
  <p>I'm probably missing something really obvious, but if anyone could help me out or show me an easier way to achieve this I would appreciate it. </p>
  
  <p>I was going to pipeline the variable to a command and strip it in that fashion, but none of the examples I've seen work, although they look much easier.</p>