Remove single quotes from javascript

1

I need to remove single quotation marks from a string, I've already tried string.replace(/\'/g, '') .replace(/"'"/g, '') and it does not work, can anyone help me?

    
asked by anonymous 09.11.2017 / 17:54

1 answer

2

Just using replace () is enough:

var a = "joao's empreendimento";
var b = a.replace(/'/g, '');
console.log(b);

Example: link

    
09.11.2017 / 18:01