Illegal unquoted character ((CTRL-CHAR, code X)): has to be escaped using backslash to be included in string value详解编程语言

报错

Illegal unquoted character ((CTRL-CHAR, code 9)): has to be escaped using backslash to be included in string value

查看是哪个字符导致的

System.out.println(new String( Character.toChars(9) )); 

纠错

把这个字符替换掉即可。

str = str.replace( new String( Character.toChars(x) ),""); 

我的code 9是制表符/t导致的问题,.replaceAll(“/t”, ” “)或.replace( new String( Character.toChars(9) ),””)替换掉即可,同理其他的/r、/n替换掉即可。

Illegal unquoted character ((CTRL-CHAR, code X)): has to be escaped using backslash to be included in string value详解编程语言

参考:
IT虾米网

原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/tech/pnotes/17768.html

(0)
上一篇 2021年7月19日 20:28
下一篇 2021年7月19日 20:28

相关推荐

发表回复

登录后才能评论