我有这个字符串:
"Test abc test test abc test test test abc test test abc"
Run Code Online (Sandbox Code Playgroud)
干
str = str.replace('abc', '');
Run Code Online (Sandbox Code Playgroud)
似乎只删除abc上面字符串中的第一次出现.如何更换所有出现的内容?
你好,你可以给我一个javascript函数来替换空格
我用Google搜索,无法让他们工作.我目前正在使用此功能:
function escapeHTMLEncode(str)
{
var div = document.createElement('div');
var text = document.createTextNode(str);
div.appendChild(text);
return div.innerHTML;
}
Run Code Online (Sandbox Code Playgroud)