无效的转义序列(有效的是\ b \ t \ n \ f \ r \" \'\\)"语法错误 [英] Invalid escape sequence (valid ones are \b \t \n \f \r \” \' \\ )" syntax error

查看:179
本文介绍了无效的转义序列(有效的是\ 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 \" \'\\)"语法错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆