I am confused to use the following escape sequence character .
var myStr=“FirstLine\n \SecondLine\\r ThirdLine”;
I am confused to use the following escape sequence character .
var myStr=“FirstLine\n \SecondLine\\r ThirdLine”;
It’s simple. If you want to define each escape sequences, you must have ‘’ before each char. Example: newline - “\n”. I think you lack some backslash in your String. Please check again.
Have Fun and Keep Coding.
Thank you bro, I missed one backslash before char.
I"m using this code to try to do the Escape Sepuence Challenge and I just can’t seem to get
it right:
var myStr = “FirstLine\n \SecondLine\r ThirdLine”;
Suggestions?
What I thought of \ was also like a space between words or in this case, breaks between code. Hope that hint helps
THE REAL ANSWER IS:
var myStr = “FirstLine\n\SecondLine\\rThirdLine”;
EXACTLY as is.