Escape Sequences in Strings challenge not accepting escape sequences
See original GitHub issueChallenge 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:
- Created 7 years ago
- Comments:37 (5 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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';
@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?