-2

jQuery:

console.log("'Wild.jpg'".replace("'", ""));

Output:

Wild.jpg'

How can I resolve this and make the output as Wild.jpg?

Cœur
  • 34,719
  • 24
  • 185
  • 251

2 Answers2

1

You should use RegEx with the g modifier instead of an ordinary string replacement:

console.log("'Wild.jpg'".replace(/'/g, ""));
Constantin Groß
  • 10,442
  • 4
  • 20
  • 47
0

Try this.. here we gave /g to replace all.

console.log("'Wild.jpg'".replace(/'/g, ""));
karthik reddy
  • 479
  • 4
  • 12