Created
September 28, 2013 07:19
-
-
Save xyqfer/6739459 to your computer and use it in GitHub Desktop.
去除首尾空白
This file contains hidden or 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
| if (!String.prototype.trim) { | |
| String.prototype.trim = function() { | |
| return this.replace(/^\s+/, "").replace(/\s+$/, ""); | |
| }; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment