js string replaceAll方法

方法:  

          String.prototype.replaceAll = function(s1,s2){

               return this.replace(new RegExp(s1,"gm"),s2);

          }

        示例代码:

          new UUID().createUUID().replaceAll("\\-", "" ).toLocaleLowerCase()


你可能感兴趣的:(JavaScript,String,uuid,replaceAll)