新手问题 irb 怎样列出 array 类的所有方法?[].methods.grep/^re/ 不行啊。

wgf4242 · March 18, 2013 · Last by zlfera replied at March 18, 2013 · 2333 hits

看书上写的 [].methods.grep/^re/ 没有提示。。。 irb(main):007:0/ [].methods.grep/^re/ irb(main):008:0*

[].methods.grep /^re/

Array.instance_methods.sort

You need to Sign in before reply, if you don't have an account, please Sign up first.