title: How to replace all dots in a string using JavaScript
body: <p>I want to replace all the occurrences of a dot(<code>.</code>) in a JavaScript string</p>
  
  <p>For example, I have:</p>
  
  <pre><code>var mystring = 'okay.this.is.a.string';
  </code></pre>
  
  <p>I want to get: <code>okay this is a string</code>.</p>
  
  <p>So far I tried:</p>
  
  <pre><code>mystring.replace(/./g,' ')
  </code></pre>
  
  <p>but this ends up with all the string replaced to spaces.</p>