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;
}
It’s very basic...it’s best to draw inferences from one example.
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn