title: Replacing white spaces to commas
body: <p>Well, i'm using regex to replace all white spaces to commas but there's a white space at the end and i don't know how to make the regex not replace him</p>
  
  <p>What I have</p>
  
  <pre><code>25DEL 38DEL A73G
  </code></pre>
  
  <p>JS</p>
  
  <pre><code> var valor = $("#mapaArquivos option:selected").val().replace(/\s+/g, ", ");
  </code></pre>
  
  <p>Output</p>
  
  <pre><code>25DEL, 38DEL, A73G,
  </code></pre>
  
  <p>Right Output</p>
  
  <pre><code>25DEL, 38DEL, A73G
  </code></pre>
  
  <p>Thanks for the help anyway!</p>