Here is a way to trim the white space from a string in Javascript:
replace(/^\s+|\s+$/g, ”)
By removing |\s+$ it will do a left trim only, and by removing ^\s+| it will do a right trim only (g is no longer necessary).
Here is a way to trim the white space from a string in Javascript:
replace(/^\s+|\s+$/g, ”)
By removing |\s+$ it will do a left trim only, and by removing ^\s+| it will do a right trim only (g is no longer necessary).