「电脑玩物」中文网最近更新

IT技术

Divide with block

07net01.com 发布于 2016-08-28

require 'set' s = %w[ant ape cow hen hog].to_set # A set of words s.divide {|x,y| x[0] == y[0]} # Divide into subsets by first letter # => #<Set:{#<Set

阅读(84)评论