title: Javascript split function to split into array at new line or white space
body: <p>I'm trying to split some text either by whitespace and/or new line, and also remove the white space before and after the whole text, just in case.  I'm not sure how to perform this as I cannot get my head around regex (I've tried other people's regex but it breaks my output) and I want to perform this using best practice rather than writing some lengthy buggy workaround</p>
  
  <p>My code can be located here:  <a href="https://github.com/Dave-Melia/Text-Separator" rel="nofollow">https://github.com/Dave-Melia/Text-Separator</a></p>
  
  <p>Many thanks</p>
  
  <p>D</p>