Escape Sequences in Strings "NOT WORKING"

Escape Sequences in Strings "NOT WORKING"
0.0 0

#1

Tell us what’s happening:

Your code so far

var myStr = "FirstLine\n\\SecondLine\\\rThridLine"; // Change this line

var myStr = "FirstLine\n\\SecondLine\\\rThirdLine";

Your browser information:

Your Browser User Agent is: Mozilla/5.0 (X11; CrOS armv7l 10032.75.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.116 Safari/537.36.

Link to the challenge:


#2

:thinking:

I have been to several different links online! I have tried this problem 10 different ways and it does NOT PASS THE CODE. Why are people saying check capitals??? If the solution they post doesn’t work in (l vs L). Or ("" vs ‘’)!

New line = \n right?
Backslash = \\ right?
Carriage-return = \r right?

So what is going wrong here. There are people on all three sites posting the wrong answer/solution. An when people try to explain their reasoning it doesn’t work. The instructions are below. I’m so lost. Someone please in Clear English without playing games…
Tell me what I’m not understanding.
I have checked spelling, CameLCase, and double quotes. And it still doesn’t pass mustard.

Sigh

/*
Instructions
Assign the following three lines of text into the single variable myStr using escape sequences.

FirstLine
\SecondLine
ThirdLine
You will need to use escape sequences to insert special characters correctly. You will also need to follow the spacing as it looks above, with no spaces between escape sequences or words.

Here is the text with the escape sequences written out.

FirstLinenewlinebackslashSecondLinebackslashcarriage-returnThirdLine
*/

Check out the following links:




#3

@404HelloWorld,
I don’t see anything wrong with your code.

I wrote the following in the challenge and it worked

“FirstLine\n\SecondLine\\rThirdLine”

What errors are you getting?


#4

Hi thanks for responding!!!

This is the error.

myStr should have encoded text with the proper escape sequences and no spacing.

The rest of the objectives are Green!


#5

try pasting the solution I wrote and see if you pass the test.


#6

i stucked with it but finally i tried that and it works
var myStr = “FristLine\n”+"\SecndeLine\" +"\rThirdLine";


#7

“FirstLinenewlinetabbackslashSecondLinenewlineThirdLine”
newline = \n
tab = \t
backslash = \\
“FirstLine\n\t\\SecondLine\nThirdLine”;