Skip to content

Removing Whitespace from String using JQuery

Last updated on October 11, 2014

JQuery provides trim method it works like Javascript trim method, it will remove all the whitespace(tab,newline characters) characters from the beginning and end of the given string.Below is the simple example script.


NOTE:Trim function only removes spaces from starting and end of the string. If there are any space between middle of the statement that is ignored.

That’s it.

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Most Voted
Newest Oldest
Inline Feedbacks
View all comments