79686450

Date: 2025-07-01 18:03:22
Score: 0.5
Natty:
Report link

Perhaps less efficient, but concise for the basic escapes without libraries using JDK 15+

  public static String escape(String s) {
    for (char c : "\\\"bfnrt".toCharArray())
      s = s.replace(("\\" + c).translateEscapes(), "\\" + c);
    return s;
  }
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: bourne2program