07 - iterating over a hash in insertion order.rb
来自「O Reilly Ruby Cookbook source code」· RB 代码 · 共 14 行
RB
14 行
require 'orderedhash'h = OrderedHash.newh[1] = 1h["second"] = 2h[:third] = 3h.keys # => [1, "second", :third]h.values # => [1, 2, 3]h.each { |k,v| puts "The #{k} counting number is #{v}" }# The 1 counting number is 1# The second counting number is 2# The third counting number is 3#---
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?