Skip to content

Instantly share code, notes, and snippets.

@nicolasblanco
Created March 25, 2009 16:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nicolasblanco/85545 to your computer and use it in GitHub Desktop.
Save nicolasblanco/85545 to your computer and use it in GitHub Desktop.
names = ["burke", "connor", "frank", "everett", "albert", "george", "harris", "david"]
query = names.inject([]) { |m, n| m << n.upcase if n.size == 5; m }.sort
query.each { |name| puts name }
# BURKE
# DAVID
# FRANCK
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment