Javascript TRIM command??

Results 1 to 2 of 2

Thread: Javascript TRIM command??

  1. #1
    Join Date
    Dec 1969

    Default Javascript TRIM command??

    What is the TRIM command in JavaScript or is there one? I need to remove any leading or trailing spaces before performing a validation using regular expressions. <BR><BR>Thanks,<BR>brian<BR>brian@compel.isgroup.n et

  2. #2
    Richard A. Lowe Guest

    Default RE: Javascript TRIM command??

    Lucky you, I wrote one:<BR><BR>function trimRegEx(strInput)<BR>{<BR> var strResult;<BR> var regex = new RegExp("(^\s+)&#124(\s+$)");<BR> strResult = strInput.replace(regex, "");<BR> return(strResult);<BR>}

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts