item.replace('P','') 只会替换第一个'P'字符 item.replace(/P/gm,'') 替换全部'P'字符 转载于:https://www.cnblogs.com/guzhanyu/p/7422358.html