「Ruby入門」ハッシュ(Hash)のサンプル
使用例
cft = {:A001 => "11", :B002 => "22", :C003=> "33"} p cft[:B002] cft = {A001: "121", B002: "212", D004: "323"} p cft[:A001]
実行結果
>ruby test1234.rb
“22"
“121"
Coding Changes the World
使用例
cft = {:A001 => "11", :B002 => "22", :C003=> "33"} p cft[:B002] cft = {A001: "121", B002: "212", D004: "323"} p cft[:A001]
実行結果
>ruby test1234.rb
“22"
“121"