title: Split a string at occurence of a space
body: <p>I have strings like "test-example - one" I need to get the characters before the space. I can split it using </p>
  
  <pre><code>this.value.substring(0, this.value.indexOf('-')
  </code></pre>
  
  <p>but it won't work if I substitute a <code>' '</code> for the  <code>'-'</code></p>