code: public static String[] delimitedListToStringArray(String str, String delimiter, String charsToDelete) {
          if (str == null) {
              return new String[0];
          }
          if (delimiter == null) {
              return new String[]{str};
          }
          List<String> result = new ArrayList<>();
          if ("".equals(delimiter)) {
              for (int i = 0; i < str.length(); i++) {
                  result.add(deleteAny(str.substring(i, i + 1), charsToDelete));
              }
          } else {
              int pos = 0;
              int delPos;
              while ((delPos = str.indexOf(delimiter, pos)) != -1) {
                  result.add(deleteAny(str.substring(pos, delPos), charsToDelete));
                  pos = delPos + delimiter.length();
              }
              if (str.length() > 0 && pos <= str.length()) {
                  // Add rest of String, but not in case of empty input.
                  result.add(deleteAny(str.substring(pos), charsToDelete));
              }
          }
          return result.toArray(EMPTY_STRING_ARRAY);
      }
docs: Take a {@code String} that is a delimited list and convert it into
  a {@code String} array.
  <p>A single {@code delimiter} may consist of more than one character,
  but it will still be considered as a single delimiter string, rather
  than as bunch of potential delimiter characters, in contrast to
  tokenizeToStringArray.
  
  @param str           the input {@code String}
  @param delimiter     the delimiter between elements (this is a single delimiter,
  rather than a bunch individual delimiter characters)
  @param charsToDelete a set of characters to delete; useful for deleting unwanted
  line breaks: e.g. "\r\n\f" will delete all new lines and line feeds in a {@code String}
  @return an array of the tokens in the list