参考:https://blog.csdn.net/maqinqin/article/details/5323824

function getStrCount(scrstr,armstr) { //scrstr 源字符串 armstr 特殊字符
     var count=0;
     while(scrstr.indexOf(armstr) != -1 ) {
        scrstr = scrstr.replace(armstr,"")
        count++;    
     }
     return count;
}

 

相关文章:

  • 2022-01-13
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-21
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-07-31
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-30
  • 2021-12-13
  • 2021-12-29
相关资源
相似解决方案