title: How to remove all string followed by (-) hyphen in javascript
body: <p>I am currently stuck with the javascript split </p>
  
  <p>i have the date like this 02/02/2014 - 14:57</p>
  
  <p>while split</p>
  
  <pre><code>var date = s.split('/');
      var timee = s.split('-');
      var hm = timee[1].split(':');
      alert(date[2]);return false; //2014 - 14:57
   return new Date(date[2], date[1], date[0], hm[0], hm[1]).getTime();
  </code></pre>
  
  <p>i just want   <code>alert(date[2]);return false; //2014</code>
  remove all other strings followed by (-) hyphen</p>
  
  <p>Thanks</p>