public static String[] split(String text,Pattern pattern){
  if (text.length() == 0) {
    return EMPTY_STRING_ARRAY;
  }
 else {
    return pattern.split(text,-1);
  }
}

public static String [ ] split ( String text , Pattern pattern ) { if ( text . length ( ) == 0 ) { return EMPTY_STRING_ARRAY ; } else { return pattern . split ( text , - 1 ) ; } }
splits a string on a pattern . string . split ( ) returns [ ' ' ] when the string to be split is empty . this returns [ ] . this does not remove any empty strings from the result .
