Last active
December 26, 2015 04:59
-
-
Save PeterRao/7096959 to your computer and use it in GitHub Desktop.
正则表达式去除首尾空格
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var trim = function(s){ | |
return s.replace(/(^\s*)|(\s*$)/g, ""); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment