This forum is now read-only. Please use our new forums! Go to forums

0 points
Submitted by Neelmani Sehgal
about 11 years

how to print double quotes inside a string in javascript?

how to print the line “I love”Sherlock Holmes” “ in javascript?

Answer 51317eb5b3e8d7da16002e44

1 vote

Permalink

You have to use an escape character. This basically means you put a backslash before the character you want to esacpe. Per your example…

"I love \"Sherlock Holmes\""

This should do the trick. Hope this helps!

points
Submitted by Patrick Bense
about 11 years