code: @NotNull
      public static String escapeChar(@NotNull final String string, final char toEscape) {
          final String toEscapeStr = String.valueOf(toEscape);
          return string.replaceAll("\\\\" + toEscapeStr, toEscapeStr).replaceAll(toEscapeStr, "\\\\" + toEscapeStr);
      }
docs: Escapes all the occurrences of the <toEscape> character from the <string> if it's not escaped already
  
  @param string   the string from which to escape the character
  @param toEscape the character to escape
  @return a new string with the escaped <toEscape> character