开发者

How do i trim in javascript or jQuery?

how do i trim using this

 $('#type_of_station').text()
开发者_如何转开发

the result is

>>> $('#type_of_station').text()
"pizza delivery system "

As you can see there is a space after the last word


jQuery: str = jQuery.trim(str);

JavaScript: str = str.replace(/^\s*/, "").replace(/\s*$/, "");


Use the JQuery.trim() function.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜