title: How can I parse the left and right values of a string that looks like this: "5 - 8"
body: <p>I have a javascript string which can contain a range. How can I get the left and the right values of this range. Note that there may be some spaces anywhere so it could look like:</p>
  
  <pre><code>"2-3"
  "2  - 3"
  " 2 - 3 "
  </code></pre>
  
  <p>Or something similar.</p>