$('.e_text-2').each(function() { const text = $(this).text().trim(); // 鑾峰彇褰撳墠鍏冪礌鐨勬枃鏈苟鍘婚櫎棣栧熬绌烘牸 const lastChar = text.trim().slice(-1); // 鑾峰彇鏂囨湰鐨勬渶鍚庝竴涓瓧 const newText = text.slice(0, -1) + `${lastChar}`; // 鍦ㄦ渶鍚庝竴涓瓧鍓嶉潰鍔犱笂鏍囩 $(this).html(newText); // 灏嗘柊鐨勬枃鏈唴瀹硅祴鍊肩粰鍏冪礌 });