It does help Stefano as I had forgotton about \n so thanks for that but
my script still does not match on my “a” value even with the chomp
method added.
Stefano C. wrote:
Alle Wednesday 01 October 2008, Jack S. ha scritto:
j = gets
puts "enter replacer word: "
h = gets
replacer(j, h)
Can someone help me determine why gsub can’t match my “a” value?
thanks
Strings returned by gets end in a newline, which doesn’t exist in your
string,
so no match happens. To solve this, you can do
I take that back Stefano…you solved it for me!
I forgot to add the x.gsub! …when I did, my script is working.
thanks a REAL lot for helping me with this!
j
Jack S. wrote:
It does help Stefano as I had forgotton about \n so thanks for that but
my script still does not match on my “a” value even with the chomp
method added.
Stefano C. wrote:
Alle Wednesday 01 October 2008, Jack S. ha scritto:
j = gets
puts "enter replacer word: "
h = gets
replacer(j, h)
Can someone help me determine why gsub can’t match my “a” value?
thanks
Strings returned by gets end in a newline, which doesn’t exist in your
string,
so no match happens. To solve this, you can do