Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
重複の可能性: 文字列を Java 文字列リテラルに変換するにはどうすればよいですか?
文字列を受け取り、対応する文字列リテラルに変換するライブラリ関数はありますか? 例:
Please say\ask "What?" three times!->"Please say\\ask \"What?\" three times!"
Please say\ask "What?" three times!
"Please say\\ask \"What?\" three times!"
commons lang StringUtils はそれを行うと思います
http://commons.apache.org/proper/commons-lang/apidocs/org/apache/commons/lang3/StringEscapeUtils.html