<div class="codetitle"> <span><a style="CURSOR: pointer" data="81405" class="copybut" id="copybut81405" onclick="doCopy('code81405')"><u>复制代码</u></a></span> 代码如下:</div> <div class="codebody" id="code81405"> <br>var data = "123123,213,,312,3,cat,dsfsdfs,"; <br>alert(func(data)); <br>function func(str) <br>{ <br>var reg = //g; <br>str = str.replace(reg,function($1){ <br>if($1=='return '}else{ <br>return '>'; <br>} <br>}); <br>return str; <br>} <br> </div> <br>很基础...能举一反三最好.