本文实例讲述了JS实现字符串中去除指定子字符串方法。分享给大家供大家参考,具体如下:
<!DOCTYPE html>
<html lang=en>
<head>
<meta charset=UTF-8>
<title>Title</title>
</head>
<body>
[removed]
/*方法一:使用replace函数替换*/
//去除字符串中含有的某字符串:str = str.replace('give', '');
var str = 'Could you please give me a simple example of how to';
co