且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

错误消息“未终止的字符串文字"

更新时间:2023-11-07 09:13:10

通过用"\\ n"替换"\ n"并用"\\ r"替换"\ r"来换码.您还需要转义单引号或双引号,具体取决于您用来定界字符串的方式.

Escape line endings by replacing "\n" with "\\n" and "\r" with "\\r". You will also want to escape single or double quotes, depending on which you are using to delimit the string.