title: How do I replace multiple spaces with a single space?
body: <p>Well I'm looking for a function that reduce multiple space characters <code>' '</code> in a string.</p>
  
  <p>For example for string <code>s</code> given :</p>
  
  <pre><code>s="hello__________world____!"
  </code></pre>
  
  <p>The function must return <code>"hello_world_!"</code></p>
  
  <p>In python we can do it via regexp simply as:</p>
  
  <pre><code>re.sub("\s+", " ", s);
  </code></pre>