“JavaScript Escape Quotes” Code-Antworten

JavaScript Escape -Zitatmethode

stringToEscape.replace(/"/g, '\\\"')
feddynventor

JavaScript Escape Escape Single Zitat

var string = 'this isn\'t a double quoted string';
var string = "this isn\"t a single quoted string";
//           ^         ^ same types, hence we need to escape it with a backslash
Batman

JavaScript Escape Quotes

let text = 'I\'m John Smith';
//I'm John Smith
let text2 = "I\"m Smith John";
//I"m Smith John
let text3 = `Es'cape "all" quotes`
//Es'cape "all" quotes
Odd Oystercatcher

Ähnliche Antworten wie “JavaScript Escape Quotes”

Fragen ähnlich wie “JavaScript Escape Quotes”

Weitere verwandte Antworten zu “JavaScript Escape Quotes” auf JavaScript

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen