jQuery:
console.log("'Wild.jpg'".replace("'", ""));
Output:
Wild.jpg'
How can I resolve this and make the output as Wild.jpg?
jQuery:
console.log("'Wild.jpg'".replace("'", ""));
Output:
Wild.jpg'
How can I resolve this and make the output as Wild.jpg?
You should use RegEx with the g
modifier instead of an ordinary string replacement:
console.log("'Wild.jpg'".replace(/'/g, ""));
Try this.. here we gave /g to replace all.
console.log("'Wild.jpg'".replace(/'/g, ""));