How to unescape a Java string literal in Java?

后端 未结 11 2034
庸人自扰
庸人自扰 2020-11-22 01:35

I\'m processing some Java source code using Java. I\'m extracting the string literals and feeding them to a function taking a String. The problem is that I need to pass the

11条回答
  •  生来不讨喜
    2020-11-22 02:18

    See this from http://commons.apache.org/lang/:

    StringEscapeUtils

    StringEscapeUtils.unescapeJava(String str)

提交回复
热议问题