-2

jQuery:

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

Output:

Wild.jpg'

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

Cœur
  • 37,241
  • 25
  • 195
  • 267

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,719
  • 4
  • 24
  • 50
0

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

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