SourceTermAnalysisSystem_vue/node_modules/xml-utils/count-substring.js
2026-05-15 10:22:44 +08:00

9 lines
242 B
JavaScript

function countSubstring(string, substring) {
const pattern = new RegExp(substring, "g");
const match = string.match(pattern);
return match ? match.length : 0;
}
module.exports = countSubstring;
module.exports.default = countSubstring;