Answers for "javascript convert forward slash to backslash"

2

replace backward slash in javascript

const data = { "\\id\\": "\\23232\\", "\\pass\\": "\\1434\\" };
console.log(data);
const b = JSON.stringify(data);
str = b.replace(/\\/g, '');
console.log(str);
Posted by: Guest on May-21-2021
0

JS toString adds backslash

var x = "<div class=\\\"abcdef\\\">";
x = x.replace(/\\"/g, '"');
document.body.appendChild(
  document.createTextNode("After: " + x)
);
Posted by: Guest on July-12-2021

Code answers related to "javascript convert forward slash to backslash"

Code answers related to "Javascript"

Browse Popular Code Answers by Language