日期:2014-05-16 浏览次数:20277 次
<SCRIPT LANGUAGE="JavaScript"> var str = "123;asdf;adwe;rter"; alert(str.replace("\;","\|")); </SCRIPT>
<SCRIPT LANGUAGE="JavaScript"> String.prototype.replaceAll = function(arg1,arg2){ return this.replace(new RegExp(arg1,"g"),arg2); } var str = "asdfsd;asdfasdf;asdfasdfas"; alert(str.replaceAll("\;","\|")); </SCRIPT>