开发交流QQ群: 173683895 173683895 526474645 人满的请加其它群
代码
const deleteStr = str =>{
if (str.indexOf("市") != -1 || str.indexOf("州") != -1){
str = str.substring(0, str.length - 1)
console.log('删除城市的最后一个字',str)
return str
}
}
util.deleteStr('廊坊市')
//删除城市的最后一个字 廊坊