Created
March 12, 2011 11:35
-
-
Save kanemu/867201 to your computer and use it in GitHub Desktop.
[groovy]全角英数を半角英数に変換
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
String str = 'Hello,1717です。' | |
str = str.replaceAll(/[\uff01-\uff5e]/){new String((char)(((int)it)-65248))} | |
assert str=='Hello,1717です。' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment