code: public static String escape(String string) {
          if (isEmpty(string)) return "";
          StringBuilder sb = new StringBuilder();
          char[] chars = string.toCharArray();
          for (int i = 0; i < chars.length; i++) {
              if (i == chars.length - 1 || chars[i] != '\r' || chars[i + 1] != '\n') {
                  sb.append(escape(chars[i]));
              }
          }
          return sb.toString();
      }
docs: Replaces carriage returns, newlines, tabs, formfeeds and the special chars defined in {@link Characters}
  with their respective escape sequences.
  
  @param string the string
  @return the escaped string