2
I need to remove simple quotes from a string, I’ve tried string.replace(/\'/g, '')
,
.replace(/"'"/g, '')
and it doesn’t work, someone can help me?
2
I need to remove simple quotes from a string, I’ve tried string.replace(/\'/g, '')
,
.replace(/"'"/g, '')
and it doesn’t work, someone can help me?
4
Only using the replace() is enough:
var a = "joao's empreendimento";
var b = a.replace(/'/g, '');
console.log(b);
Example: https://jsfiddle.net/85bnxq5x/
AP code works. I think the problem is another...
I tested both ways and the code suggested by @Everson worked, I really appreciate all your help
@Leonardoebert Thank you for the return and I’m glad you helped him ;)
Browser other questions tagged javascript node.js replace
You are not signed in. Login or sign up in order to post.
You can show an example of the string?
– Sergio
I see no problem with replace, probably not re-assigning, thus:
string.replace(/\'/g, '')
must bestring = string.replace(/\'/g, '')
, because replace itself does not alter the string.– BrTkCa
It would be something like this:
dataVencimento: '{$gte:ISODate("2017-11-09T02:00:00.000Z")}'
Need to remove single quotes before{$gte
and after)}
– LeonardoEbert
Your code works for this string... https://jsfiddle.net/Sergio_fiddle/jefwatnk/
– Sergio