Hello Ruby Friends,
From now on, I'll prefix my questions w YANQ (yet another (ruby) newbie
question) so it would be easier for you to delete (in case :-).
My YANQotd is regarding string#concat. A sample code and output would be
good to illustrate:
C:\family\ruby>type a1.rb
fn = "bot"
ln = "pen"
name = fn.concat(ln)
print "first name: ", fn
puts
print "last name : ", ln
puts
print "full name : ", name
C:\family\ruby>ruby a1.rb
first name: botpen
last name : pen
full name : botpen
I noticed that concat modified fn. I looked for other concat methods but
couldn't find one (but the + op). I was hoping that there would be a concat!
and concat pair (like chop!/chop and chomp!/chomp).
Maybe string#concat! was deprecated for "+"? My concern is that (as a
newbie), I'm trying to avoid methods with "!" (like chomp!/chop!) so I have
less to worry/know. My strategy was working and I was actually coding w
breeze... until I bump.. :-(
Pls enlighten.
kind regards,
-botp