Heorhii Lysenko Asked:2020-01-24 22:48:53 +0000 UTC2020-01-24 22:48:53 +0000 UTC 2020-01-24 22:48:53 +0000 UTC \u android 格式的西里尔字符 772 你好,问题是这样的:有一个EditText,我从中得到一个可以包含西里尔字符的字符串。如何将此字符串转换为带有 \u 代码的转义序列? java 1 个回答 Voted Best Answer Barmaley 2020-01-24T23:54:17Z2020-01-24T23:54:17Z 使用Apache Commons StringEscapeUtils String escapedString=StringEscapeUtils.escapeJava("Привет"); 添加到项目中: compile 'org.apache.commons:commons-lang3:3.6' 更新程序 该类已从包commons.lang3中移至commons.text 添加到项目中: implementation 'org.apache.commons:commons-text:1.9' 导入自身 import org.apache.commons.text.StringEscapeUtils;
使用Apache Commons StringEscapeUtils
添加到项目中:
更新程序
该类已从包
commons.lang3
中移至commons.text
添加到项目中:
导入自身