From: Jack Smith Date: 2008-10-02T05:51:30+09:00 Subject: Re: simple gsub method 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 Crocco wrote: > Alle Wednesday 01 October 2008, Jack Smith 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 > > j = gets.chomp > > and the same for h. > > I hope this helps > > Stefano -- Posted via http://www.ruby-forum.com/.