Created
May 21, 2013 13:16
-
-
Save baobao/5619683 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 str:String = " hoge hoge "; | |
var reg:RegExp = /^[ ]+|[ ]+$/g; | |
var result:String = str.replace(reg, ""); | |
trace("|" + result + "|"); //ourpur::hoge hoge |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment