js去掉首尾换行和空格

str=str.replace(/^\s+|\s+$/g,'')

 

posted @ 2021-08-17 15:47  bingyingks  阅读(497)  评论(1)    收藏  举报