实现方法如下:
function shortenOrganName(organ) {
var deleteWords = ['第', '审查调查', '监督检查'];
$.each(deleteWords, function (index, val) {
organ = organ.replace(new RegExp(val,'gm'),'')
})
return organ;
}
console.log(shortenOrganName('第十一审查调查室')); //十一室