天天看点

js实现字符串替换和所有字符串替换

  1. var s = "6101000000";
  2. s.replace( "00", "__"); //替换第一个6101__0000
  3. s.replace( /00/g, "__") //替换所有6101______