title: Remove space between words in string javascript js React
body: <p>I'm using React (hooks) and in a component I have postcodes with a space in them in strings:
   eg "B72 1JL".</p>
  
  <p>I need to remove the space in the middle of the postcodes so it is "B721JL" and also possibly any spaces before or after the postcode. </p>
  
  <p>I've googled for ages and cannot find anything that will work. I know i probably need regex...but pretty confused!<br>
  Help appreciated.</p>