R
Ruby Newbee
Hello,
I tried to grep from a string, but got wrong.
irb(main):010:0* x = "hello world baby girl"
=> "hello world baby girl"
irb(main):011:0>
irb(main):012:0*
irb(main):013:0* x.grep(/hello/)
NoMethodError: undefined method `grep' for "hello world baby girl":String
from (irb):13
from /usr/bin/irb:12:in `<main>'
where shall 'grep' method come from?
thanks~
I tried to grep from a string, but got wrong.
irb(main):010:0* x = "hello world baby girl"
=> "hello world baby girl"
irb(main):011:0>
irb(main):012:0*
irb(main):013:0* x.grep(/hello/)
NoMethodError: undefined method `grep' for "hello world baby girl":String
from (irb):13
from /usr/bin/irb:12:in `<main>'
where shall 'grep' method come from?
thanks~