$.trim()是jQuery提供的函数,用于去掉字符串首尾的空白字符。 "abc 123 def".replace(/\s/g, "") 去除所有的空格 相关文章: 2021-07-28 2022-02-11 2021-08-04 2022-12-23 2022-02-14