My test assignment when hiring was to optimize this code:
someString.replaceAll("\\"", "\'").replaceAll("\\n", ""