From: Robert Klemme Date: 2013-07-26T20:36:15+09:00 Subject: Re: replace words using gsub --047d7bb03e6ad73bba04e2688cc0 Content-Type: text/plain; charset=ISO-8859-1 On Fri, Jul 26, 2013 at 12:56 PM, botp wrote: > On Fri, Jul 26, 2013 at 2:34 PM, Robert Klemme > wrote: > > > body.gsub(/\w+/) {|m| subs[m]} > > => "I am he" > > forgot the original : ) > What are you trying to say? > > body.gsub(/\w+/,subs) > => "I am he." > I do not see that with Ruby 1.9* (see above). Is this Ruby 2.0 behavior? Cheers robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/ --047d7bb03e6ad73bba04e2688cc0 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable



On Fri, Jul 26, 2013 at 12:56 PM, botp <botpena@gmail.com><= /span> wrote:
On Fri, Jul 26, 2013 at 2:= 34 PM, Robert Klemme
<shortcutter@googlemail.co= m> wrote:
> > body.gsub(/\w+/) {|m| subs[m]}
> =3D> "I am he"

forgot the original : )

What are = you trying to say?
=A0
> b= ody.gsub(/\w+/,subs)
=3D> "I am he."

I do not see that with Ruby 1.9* (see above). =A0Is this Ruby = 2.0 behavior?

Cheers

robert

--
remember.guy do |as, often| = as.you_can - without end
= http://blog.rubybestpractices.com/
--047d7bb03e6ad73bba04e2688cc0--