.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month

Home >> Code Snippets >> JQuery >> Post New Resource Bookmark and Share   

 Subscribe to Code Snippets

Remove spaces from string using JQuery Trim()

Posted By:Amit Mehra       Posted Date: March 10, 2010    Points: 10    Category: JQuery    URL: http://www.dotnetspark.com  

Remove white spaces from string using JQuery using trim() function in asp.net. This function will be used when you need to trim or delete spaces.

JQuery.trim() function is used to trim white spaces embedded along with the string . It will remove the spaces before and after the string.


var str = jQuery.trim("your string which need to be trim");

Lets see how to use it

    // Add JQuery Reference

In the above example i have used html button click and I am trimming the string.


Further Readings:

Author: Virendra Dugar         Company URL: http://www.dotnetspark.com
Posted Date: April 18, 2011


Thanks for the useful article.

using Trim(), you can also check whether item is empty or not. See below link.




Post Comment

You must Sign In To post reply
Find More code samples in C#, ASP.Net, Vb.Net and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend