JS去掉指定字符串可以用字符串替换函数replace吧,str="1831,1829,1812,1829,134,171"str=str.replace("1812,","")至于去掉首尾,我想到的2023-04-14JavaScript250