<div class="codetitle"> <span><a style="CURSOR: pointer" data="74035" class="copybut" id="copybut74035" onclick="doCopy('code74035')"><u>复제대码</u></a></span> 代码如下:</div> <div class="codebody" id="code74035"> <br>/**<br>* 문자열의 <br>* 모두 바꾸기 @param obj 원래 문자열 <br>* @param str1 대체 규칙 <br>* @param str2 대체할 내용 <br>* @return 대체된 문자열<br>*/ <br>함수 replacementAll(obj ,str1,str2){ <br>var result = obj.replace(eval("/" str1 "/gi"),str2); <br>반환 결과; <br>} <br> </div> <br>例如: <br><div class="codetitle"> <span><a style="CURSOR: pointer" data="65749" class="copybut" id="copybut65749" onclick="doCopy('code65749')"><u>复代码</u></a></span> 代码如下:</div> <div class="codebody" id="code65749"> <br><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <br><html> <br><머리> <br><제목> 새 문서 </title> <br><meta name="Generator" content="EditPlus"> <br><meta name="저자" content=""> <br><meta name="키워드" content=""> <br><meta name="Description" content=""> <br><script type="text/javascript"> <br>function replacementAll(obj,str1,str2){ <br>var result = obj.replace(eval("/" str1 "/gi"),str2); <br>반환 결과; <br>} <br>alert(replaceAll("111,222,333",",","|")); <br></script> <br></head> <br><본문> <br></body> <br></html> <br> </div>