code: public static List<String> split(String s, String separator) {
          if (s == null) return null;
          List<String> rslt = null;
          if (s.isEmpty() || isEmpty(separator)) {
              rslt = new ArrayList<>(1);
              rslt.add(s);
              return rslt;
          }
  
          //return s.split(COMMA_SPLIT); - NOT WORKING when compiled to JS
  
          int start = 0;
          int p = start;
          do {
              int j = s.indexOf(separator, p);
              if (j == -1) {
                  if (rslt == null) {
                      rslt = new ArrayList<>(1);
                      rslt.add(s);
                      return rslt;
                  }
                  rslt.add(s.substring(start));
                  break;
              }
              if (j > 0 && s.charAt(j - 1) == '\\') {
                  p = j + 1;
                  continue;
              } else {
                  if (rslt == null) rslt = new ArrayList<String>();
                  rslt.add(s.substring(start, j));
                  start = j + 1;
                  p = start;
              }
  
          } while (true);
  
          return rslt;
      }
docs: Splits string by separator, if separator in string is backslashed, i.e. prefixed by \ then
  it's ignored(preserved).