定义调用
function replace_All(str,old,newall) {
return str.replace(new RegExp(old,"gm"),newall);
}
调用
//注释值为调用的原始值和转换后的值
//CN=testc,OU=@0201105199809085058+OU=内科,O=河南测试系统,L=郑州市,ST=河南省,C=CN
dn= replace_All(dn,"\\+",",");
dn= replace_All(dn,"ST=","S=");
dn= replace_All(dn,",",", ");
//CN=testc, OU=@0201105199809085058, OU=内科, O=河南测试系统, L=郑州市, S=河南省, C=CN