找出一串字符中某个字符出现过几次 很简单的一行代码 let str = ‘鸡你太美 你干嘛’ let count = str .split(‘你’).length - 1 console.log(count ) // 打印结果为2