Created
December 14, 2017 15:59
-
-
Save kazuhito-m/5fa635195913d00a599621d8b0f54ff2 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
def target = this.args[0] | |
/** | |
* ASCII(&ある種決まった記号)のみで構成されているかを真偽値で返す。 | |
*/ | |
def isAsciiOnly(text) { | |
def valids = ['-', '_'] | |
for (c in text.split('')) { | |
if (((int) c) > 127 && !valids.contains(c)) return false | |
} | |
return true | |
} | |
println "結果 : " + isAsciiOnly(target) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment