Is there a Java method that works like Python\'s repr? For example, assuming the function were named repr,
\"foo\\n\\tbar\".repr()
would re
In case you are using Groovy, it provides a similar StringEscapeUtils class as Apache Commons Lang:
StringEscapeUtils.escapeJava("foo\n\tbar")