code: public static String[] split(String str, String separator){
      
      	return Pattern.compile(separator).split(str, -1);
      }
docs: Split the String passed in parameter, the trailing empty string are kept.
  @param str the string to split
  @param separator the separator
  @return the splitted string