Created
August 5, 2015 05:50
-
-
Save raymondmars/ee6636cea5115424737f 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
class String | |
def get_upcase | |
self.split('').map(&:ord).select{|x| x >=65 and x<=90}.map(&:chr) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment