code: public static void split(String input, char delimiter, Consumer<String> callbackPerSubstring) {
          if(input == null) throw new NullPointerException("input cannot be null");
          
          final int len = input.length();
          
          int lastMark = 0;
          for (int i = 0; i < len; i++) {
              if (input.charAt(i) == delimiter) {
                  callbackPerSubstring.accept(input.substring(lastMark, i));
                  lastMark = i + 1;// 1 == delimiter length
              }
          }
          callbackPerSubstring.accept(input.substring(lastMark, len));
      }
docs: Splits a string into an array using a provided delimiter.
  The callback will be invoked once per each found substring
  
  @param input string to split.
  @param delimiter  delimiter
  @param callbackPerSubstring called for each splitted string