Created
April 30, 2009 08:31
-
-
Save maraigue/104347 to your computer and use it in GitHub Desktop.
与えられた文字列の先頭が、特定の文字(ASCIIに限定してよい)であるか判定(Ruby1.8, 1.9共通)
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
| #!/usr/bin/env ruby | |
| # 与えられた文字列の先頭が "#" であるか判定 | |
| def comment?(str) | |
| str[0] == "#"[0] | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment