title: String.split with a regex and a limit doesn't have expected behaviors
body: <p>I'm working on a simple gadget that divides the xpath of a specific element into smaller pieces by finding the "/"s in the xpath and using java's split method. My code is as follows:</p>
  
  <pre><code>String test = "/html[1]/body[1]/div[1]/div[7]/div[3]/form[1]/div[1]/div[1]/div[1]/div[2]/div[1]/div[2]/a[1]";
  String[] split = test.split("/");
  for (int i = 0; i &lt; split.length; i++) {
    System.out.println(split[i]);
  }
  </code></pre>
  
  <p>It worked, and I got the result:</p>
  
  <pre><code>html[1]
  body[1]
  div[1]
  div[7]
  div[3]
  form[1]
  div[1]
  div[1]
  div[1]
  div[2]
  div[1]
  div[2]
  a[1]
  </code></pre>
  
  <p>However, then I decided that I would like to split the xpath into 2 pieces separated by the first "/" in the xpath. I used the split method with a regex and a limit, I changed my code to:</p>
  
  <pre><code> String test = "/html[1]/body[1]/div[1]/div[7]/div[3]/form[1]/div[1]/div[1]/div[1]/div[2]/div[1]/div[2]/a[1]";
   String[] split = test.split("/",2);
   for (int i = 0; i &lt; split.length; i++) {
     System.out.println(split[i]);
   }
  </code></pre>
  
  <p>It doesn't work, and gives the result:</p>
  
  <pre><code>html[1]/body[1]/div[1]/div[7]/div[3]/form[1]/div[1]/div[1]/div[1]/div[2]/div[1]/div[2]/a[1]
  </code></pre>
  
  <p>Thanks to melli-182's comment, I realized that it is actually dividing the string into an empty string and the original string, which is not what I expected. Is there a way to make it work properly?</p>
  
  <p>Thank you very much!</p>