CS1022
error Unknown escape sequence esc.
#What it means
Inside a string, a backslash starts an escape sequence. This one is not a known escape.
#Typical cause
- A file path or other text with single backslashes, such as
"C:\data". - A
\uescape without exactly four hexadecimal digits after it.
#How to fix it
Use one of the known escapes: \\ (a backslash), \", \', \n (new line), \t (tab) or \uXXXX; in a template literal also \` and \$. To show a backslash, write it twice.
#Example
//@chartscript 1
indicator("Escapes")
const note = "Up\Down"
plot(close, note)Fixed
//@chartscript 1
indicator("Escapes")
plot(close, "Up\\Down")#Related
- CS1021 — This string is not closed on the same line.