title: Splitting spaces unless there's brackets in a string. Java
body: <p>For example let's say there's a string like: "A B (C D) E"</p>
  
  <p>I would like to split the string into an array list like:</p>
  
  <ol>
  <li>Array1 "A"</li>
  <li>Array2 "B"</li>
  <li>Array3 "C D"</li>
  <li>Array4 "E"</li>
  </ol>
  
  <p>At the moment it's like this:</p>
  
  <ol>
  <li>Array1 "A"</li>
  <li>Array2 "B"</li>
  <li>Array3 "(C"</li>
  <li>Array4 "D)"</li>
  <li>Array5 "E"</li>
  </ol>
  
  <p>This is what I have to split the spaces:</p>
  
  <pre><code>Scanner Str = new Scanner(input); 
  if (Str.hasNext())
      for(int i = 0; Str.hasNext(); i++) {
          args.add(i, Str.next());
      }
  </code></pre>
  
  <p>Thank you for your time</p>