Skip to content

Instantly share code, notes, and snippets.

@raymondmars
Created August 5, 2015 05:50
Show Gist options
  • Save raymondmars/ee6636cea5115424737f to your computer and use it in GitHub Desktop.
Save raymondmars/ee6636cea5115424737f to your computer and use it in GitHub Desktop.
提取字符串中得的大写字符
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