ivaneeo's blog

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

  BlogJava :: 首页 :: 联系 :: 聚合  :: 管理
  669 Posts :: 0 Stories :: 64 Comments :: 0 Trackbacks
while gets
if /Ruby/
print
end
end

##等同代码

ARGF.each {|line| print line if line =~ /Ruby/ }
##ARGF
##An object providing access to virtual concatenation of files passed as command-line
##arguments or standard input if there are no command-line arguments. A synonym for
##$<.

##等同代码
print ARGF.grep(/Ruby/)
posted on 2006-09-12 16:07 ivaneeo 阅读(281) 评论(0)  编辑  收藏 所属分类: ruby-宝石也锋芒

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


网站导航: