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.