Trim a String in jQuery

This will be a quick tutorial on how to remove the excess whitespace from the beginning and end of a string using jQuery. All you have to do is call the trim function like this:

var new_string = jQuery.trim(string_to_trim);

Just a quick look at a very basic function.

Leave a Reply

Your email address will not be published. Required fields are marked *