code: public static List<String> split(String string, String delimiter,
              boolean ignoreEmpty) {
          List<String> result = new ArrayList<String>();
          if (string.isEmpty() || delimiter.isEmpty()) {
              result.add(string);
              return result;
          }
          int position = 0, next = 0;
          while (next >= 0) {
              next = string.indexOf(delimiter, position);
              String token;
              if (next < 0) {
                  token = string.substring(position);
              } else {
                  token = string.substring(position, next);
              }
              if (!(token.isEmpty() && ignoreEmpty)) {
                  result.add(token);
              }
              if (next >= 0) {
                  position = next + delimiter.length();
              }
          }
          return result;
      }
docs: Splits the string around the given delimiter
  
  @param string is the string to split
  @param delimiter is the substrings on which the string will be split
  @param ignoreEmpty whether the empty strings are discarded
  @return the string split around the given delimiter