[英]How to remove all occurrence of character ' in a string in Javascript?
My string is like (passenger's name is Suraj and passenger's contact number is XXXXXXX672
). 我的字符串就像(乘客的名字是Suraj,乘客的联系电话是
XXXXXXX672
)。 How can I remove the occurrences of ' from the string ? 如何从字符串中删除出现的'? I tried using
我尝试使用
comments = comments.replace(/'/g, ' '); and comments = comments.replace(/\'/g, ' ');
But they did not work. 但是他们没有用。 Please suggest me the needful.
请建议我有需要。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.