replaceAll() 함수가 IE에서 안먹는 경우가 있다..
replace 정규식으로 해당 모든 문자를 치환할 수 있다!!
String변수.replaceAll("!" , "~");
String변수.replace(/!/g , '~');
replaceAll(), replace() 사용 예제:
public class ReplaceAllExample{
public static void main(String[] args){
String str1 = "Hello!! World!!";
String replaceAllStr = str1.replaceAll("!" , "~");
String replaceStr = str1.replace(/\!/g , '~');
System.out.println(replaceAllStr); // Hello~~ World~~
System.out.println(replaceStr); // Hello~~ World~~
}
}