ivaneeo's blog

自由的力量,自由的生活。

  BlogJava :: 首页 :: 联系 :: 聚合  :: 管理
  669 Posts :: 0 Stories :: 64 Comments :: 0 Trackbacks
##数组
a = [ 'ant', 'bee', 'cat', 'dog', 'elk' ]
a[0]
a[3]
# this is the same:
a = %w{ ant bee cat dog elk }
a[0]
a[3]

##hash表
inst_section = {
'cello' => 'string',
'clarinet' => 'woodwind',
'drum' => 'percussion',
'oboe' => 'woodwind',
'trumpet' => 'brass',
'violin' => 'string'
}

inst_section['oboe']
inst_section['cello']
inst_section['bassoon']
posted on 2006-09-12 15:10 ivaneeo 阅读(234) 评论(0)  编辑  收藏 所属分类: ruby-宝石也锋芒

只有注册用户登录后才能发表评论。


网站导航: