Trim Function in JavaScript

function trim(stringToTrim)
{
return stringToTrim.replace(/^\s+|\s+$/g,”");
}

Leave a Reply

You must be logged in to post a comment.