返回顶部

收藏

Convert set to array

更多
require 'set'

s = (1..3).to_set
s.to_a          # => [1, 2, 3]

标签:Ruby,集合

收藏

0人收藏

支持

0

反对

0

»更多 您可能感兴趣的代码
  1. 2016-02-04 11:37:45Collect in place by 永明
  2. 2016-04-24 14:08:00Map elements in a set by digua
  3. 2016-08-28 09:29:05Sort on two arrays by jeffsui
  4. 2016-08-28 13:17:44Convert a hash to set and divide by zetaliang
  5. 2016-09-20 09:21:04Divide a set by absolute value by 好好学习啊
  6. 2016-11-19 09:06:23Building a Histogram by Ω油菜
  7. 2016-04-24 14:16:11Create Your stack by Loli控
  8. 2016-08-28 09:48:44extend Forwardable by 好好学习啊
  9. 2016-08-28 13:39:21Add set operation to Array by 永明
  10. 2016-09-03 12:08:57Writing Block Methods that Classify or Collect by Jamin
  11. 2016-12-25 16:45:49The intersection is the set of values that appear in both by 好好学习啊

发表评论