Escape Sequences in Strings -- help me

Escape Sequences in Strings -- help me
0.0 0

#1

Tell us what’s happening:

Your code so far

var myStr = "Firstline \n Secondline \r Thirdline \\" ;//Change this line


Your browser information:

Your Browser User Agent is: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:59.0) Gecko/20100101 Firefox/59.0.

Link to the challenge:


#2

There should be no spaces in myStr. Also, you are not putting the \ before and after SecondLine. Not sure why you put a \ after Thirdline.


#3

I tried,
var myStr=“FirstLine\n \SecondLine\ \rThirdLine”;
but it is not working.

Please correct me.


#4

I got it.
var myStr=“FirstLine\n\SecondLine\\rThirdLine”;

Thank you for your reply.