Removing Whitespace from String using JQuery

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.

I hope you like this Post, Please feel free to comment below, your suggestion and problems if you face - we are here to solve your problems.

Leave a Reply

Your email address will not be published.