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.

I am Arjun from Hyderabad (India). I have been working as a software engineer from last 7+ years, and its my passion to learn new things and implement them as a practice. Aside from work, I likes gardening and spending time with pets. Protection Status