时间:2021-07-01 10:21:17 帮助过:3人阅读
var data = "123123,213,<,12312,>,312,3,cat,dsfsdfs,";
alert(func(data));
function func(str)
{
var reg = /<|>/g;
str = str.replace(reg,function($1){
if($1=='<'){
return '<';
}else{
return '>';
}
});
return str;
}
很基础...能举一反三最好.