I’ve been stuck on this and am getting quite frustrated. I can’t figure out what I’m doing wrong! I’ve tried multiple variations of this, changing spacing and no spacing, and haven’t been able to find anyone else that had trouble with this step. Can someone please tell me what I’m doing wrong? Thank you!! :~)
You have semi-colon midway. It should be
var myStr = ....
There should be a
var myStr = "Firstline\n\\SecondLine\\\r Thirdline;
Hmm, okay. So that worked (thank you!!) but on startup, why does the already inputted text read:
var myStr ;
var myStr =
Is this just an error?
Glad it worked.
var myStr; is just initialising the variable without giving it at a value.
var myStr = is incorrect because JS expects a value after the
= and also a
;at the end of the line. This would be correct:
var myStr = "";.
anyone please help why this is not working
A backslash should be escaped as well. So
\\ will give you one backslash.
Mine doesn’t work and I can’t figure it out for the life of me, I don’t get it help plox. I have it written as:
var myStr=“FirstLine\n \\SecondLine\\ \rThirdLine”;
You’re almost there. I believe the spaces are what’s causing it not to pass. I think if you remove the spaces after
\n and before
\rThirdLine"; you’ll be set.
This worked for me.
So new line ===\n
backslash === double \
carriage return ===\r
why the hell not wrking…?
You haven’t escaped backslashes.
Ya i Got It later… Thanks(
Thanks for posting, I needed the help!
this one works
var myStr=“FirstLine\n\SecondLine\\rThirdLine”;// Change this line
This is correct one . should be double backslash rather than \
I Completed this exercise by using this
I can’t understand the difference between \n and \r
why \r before ThirdLine (why not \n here also)
can anyone explain
thanks in advance