Escaping Literral Quotes in Strings

I don’t know why the quotes are coming before and after the sentence as well

Your code so far


var myStr = " I am a \"double quoted\" string inside \"double quotes\" . " ; // Change this line

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0.2 Safari/605.1.15.

Challenge: Escaping Literal Quotes in Strings

Link to the challenge:

There are quotes before and after the sentence because all strings are surrounded by quotation marks.

Then how do I remove them

You can’t and shouldn’t. Why do you want to remove them?

Because the code is not accepted

You need to have the quotation marks around your string.

The problem is that the contents of the string are not an exact match for I am a "double quoted" string inside "double quotes".

You have extra spaces in your string at the beginning and the end.

You can see the extra spaces in the console output, at the bottom right corner:

1 Like

It worked thank you so mich

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.