On Wed, Aug 29, 2012 at 11:33 AM, Joakim L. [email protected]
wrote:
Thanks, Robert!
YWC.
That helped
Good!
I suppose pname.chomp! would mean the same as pname = pname.chomp then.
It has the same effects in your specific example. But effects will be
different if there is another reference the object referred to by
pname. In that case #chomp! and #chomp will behave differently
because with exclamation mark you’ll see the same object through both
references but without and assignment you won’t.
Kind regards
robert
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.