title: StringUtils splits based on regex
body: <p>I have a following code to split my input String:</p>
  
  <pre><code>import org.apache.commons.lang.StringUtils;
  
  public class SplitTest {
  
      public static void main(String args[]) {
          String input = "A||B||||D||E";
          String result[] = StringUtils.split(input, "||");
  
          for (int i = 0; i &lt; result.length; i++) {
              System.out.println("result[" + i + "]:" + result[i]);
          }
      }
  }
  </code></pre>
  
  <p>And I was expecting output as:</p>
  
  <p><strong>Expected Output:</strong></p>
  
  <pre><code> result[0]:A
   result[1]:B
   result[2]:
   result[3]:D
   result[4]:E
  </code></pre>
  
  <p><strong>Real Output:</strong></p>
  
  <pre><code>result[0]:A
  result[1]:B
  result[2]:D
  result[3]:E
  </code></pre>
  
  <p>Can anyone tell me why this is happening? What Can I do to achieve my expected output?</p>