• Download Gist
1 2 3 4 5 6 7 8
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"

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.