// 提取特殊字符串长度(scrstr 源字符串 armstr 特殊字符) getStrCount: function(scrstr, armstr) { var count = 0; while (scrstr.indexOf(armstr) >= 1) { scrstr = scrstr.replace(armstr, "") count++; } return count; }