Technology
 

Trim Whitespace from a String

From Unofficial Konfabulator Wiki

This function will trim any whitespace from the left and right of a string and return whatever remains.


 function trim(s) {
 	return (s.toString().replace(/^\s*|\s*$/g,''));
 }
Rate this article: