question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Escape Sequences in Strings challenge not accepting escape sequences

See original GitHub issue

Challenge Escape Sequences in Strings has an issue. User Agent is: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2756.0 Safari/537.36 OPR/40.0.2267.0 (Edition developer). Please describe how to reproduce this issue, and include links to screenshots if possible.

My code:

var myStr = "Here is a backslash:\\.\n \t\t Here is a new line with two tabs.";

Screenshot: https://i.sli.mg/hEmocD.png

I asked for help in the chatroom and my solution was the same as others who had successfully completed the challenge.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:37 (5 by maintainers)

github_iconTop GitHub Comments

8reactions
charlesBakcommented, Jun 25, 2016

the string should look like this. there is no space between the second tab and the second line.

myStr = 'Here is a backslash: \\.\n\t\tHere is a new line with two tabs';

7reactions
erictleungcommented, Jun 23, 2016

@aicccia To complete this challenge, you’ll need to be very precise. There should be a space before the first escape backslashes, no space between the new line character and tab, and no space between the tab and “Here”.

@FreeCodeCamp/issue-moderators I recently updated the challenge and it checks for a very precise string and I think it’ll be difficult and possibly confusing to ask for those specific spaces. I think a better solution would be to write a regex looking for the string and accommodate for spaces around the escape characters. Thoughts?

Read more comments on GitHub >

github_iconTop Results From Across the Web

what is wrong with my code in this "Escape Sequences in ...
Solution: we use newline(\n) after FirstLine, use tab(\t) and backslash(\) before SecondLine and newline(\n) after SecondLine. Share.
Read more >
Escape Sequences in Strings SecondLine\\ - JavaScript
Here your code fails of course, becasue once browser reaches \S it finds it faulty, simple becasue there is no \S! Challenge needs...
Read more >
Escape sequences - IBM
Use escape sequences only in character constants or in string literals. An error message is issued if an escape sequence is not recognized....
Read more >
When to escape characters - Splunk Documentation
An escape sequence is a set of characters used in string literals that have a special meaning, such as a new line, a...
Read more >
Preventing Escape Sequence Interpretation in Python
The error is caused because the \U in the string leads to the next 4 characters being treated as a 32-bit Hexadecimal value...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found