Tag: 修剪

从javascriptstring修剪\ n,\ s,\ t

我有一个jQueryselect器,它在select器中获取html ,如下所示: $('.pp-product-description .noindent').html() 这是一个输出示例,我已经validation它是一个string: <li class="standardBulletText">600 fill power down adds warmth without weight</li> \r\n\t\t\t\t\t\t \t <li class="standardBulletText">Matte shell with DriOff&trade; finish for water-resistant protection</li>\ r\n\t\t\t\t\t\t \t <li class="standardBulletText">Snap-off, adjustable hood with removable faux fur trim</li> \r\n\t\t\t\t\t\t \t<li class="standardBulletText">Hidden zip/snap closure except for top and bottom snaps</li> 我正在尝试修剪,以便\r , \n和\t字符消失。 我目前正在使用nodeJS ' validate模块 ,它有一个特殊的sanitize(string).trim()命令应该修剪掉空白。 从文档: […]