Skip to content

Instantly share code, notes, and snippets.

@bamboo
Created October 9, 2010 13:05
Show Gist options
  • Save bamboo/618168 to your computer and use it in GitHub Desktop.
Save bamboo/618168 to your computer and use it in GitHub Desktop.
import System.Linq.Enumerable
words = ("blueberry", "chimpanzee", "abacus", "banana", "apple", "cheese")
wordGroups = words.GroupBy({ w | w[0] })
for g in wordGroups:
print "Words that start with the letter $(g.Key):"
for word in g: print "\t$word"
@carlrosenberger
Copy link

Nice

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment