本文介绍了无效的转义序列(有效的是\ b \ t \ n \ f \ r \" \'\\)"语法错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
print(" $$$$$$\ $$$$$\ $$$$$$\ $$\ $$\ "+newline+
"$$ __$$\ \__$$ | $$ __$$\ $$ | $$ |"+newline+
"$$ / $$ | $$ | $$ / $$ | \$$\ $$ |"+newline+
"$$$$$$$$ | $$ | $$$$$$$$ | \$$$$ /"+newline+
"$$ __$$ | $$\ $$ | $$ __$$ | $$ $$< "+newline+
"$$ | $$ | $$ | $$ | $$ | $$ | $$ /\$$\"+newline+
"$$ | $$ | \$$$$$$ | $$ | $$ | $$ / $$ |"+newline+
"\__| \__| \______/ \__| \__| \__| \__|"+newline);
大家好!我只是想将ascii艺术添加到我的游戏GUI中,并且出现此错误?我该如何解决?
Hi all ! I am just trying to add ascii art to my games gui, and I get this error? How do I resolve this?
推荐答案
反斜杠字符\
是转义符(在Java中).编译器认为您正在尝试转义下一个字符,并且\_
是无效的转义序列.您需要转义反斜杠本身.将每个\
替换为\\
.
The backslash character \
is an escape character in Java. The compiler thinks that you are attempting to escape the next character, and \_
is an invalid escape sequence. You need to escape the backslash itself. Replace every \
with \\
.
这篇关于无效的转义序列(有效的是\ b \ t \ n \ f \ r \" \'\\)"语法错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!