Created
August 20, 2012 21:55
-
-
Save afbroman/3408252 to your computer and use it in GitHub Desktop.
Ruby: drop first three array elements and sort by two elements
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
genomes.drop(3).sort do |a, b| | |
comp = a[1].downcase <=> b[1].downcase | |
comp.zero? ? (a[2].downcase <=> b[2].downcase) : comp | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment