title: Splitting a string in Java using multiple delimiters
body: <p>I have a string like </p>
  
  <pre><code>String myString = "hello world~~hello~~world"
  </code></pre>
  
  <p>I am using the split method like this</p>
  
  <pre><code>String[] temp = myString.split("~|~~|~~~");
  </code></pre>
  
  <p>I want the array temp to contain only the strings separated by ~, ~~ or ~~~.</p>
  
  <p>However, the temp array thus created has length 5, the 2 additional 'strings' being empty strings.</p>
  
  <p>I want it to ONLY contain my non-empty string. Please help. Thank you!</p>