title: Remove all dots except the first one from a string
body: <p>Given a string</p>
  
  <pre><code>'1.2.3.4.5'
  </code></pre>
  
  <p>I would like to get this output</p>
  
  <pre><code>'1.2345'
  </code></pre>
  
  <p>(In case there are no dots in the string, the string should be returned unchanged.)</p>
  
  <p>I wrote this</p>
  
  <pre><code>function process( input ) {
      var index = input.indexOf( '.' );
  
      if ( index &gt; -1 ) {
          input = input.substr( 0, index + 1 ) + 
                  input.slice( index ).replace( /\./g, '' );
      }
  
      return input;
  }
  </code></pre>
  
  <p><strong>Live demo:</strong> <a href="http://jsfiddle.net/EDTNK/1/" rel="noreferrer">http://jsfiddle.net/EDTNK/1/</a></p>
  
  <p>It works but I was hoping for a slightly more elegant solution...</p>