From: Peter Bailey Date: 2006-04-07T20:27:41+09:00 Subject: Re: Basic input/output question Dimitri Aivaliotis wrote: > On 4/6/06, Peter Bailey wrote: > >> Cool. Thanks! So, in James' example, he uses "sub" instead of "gsub." >> Are they the same thing? > > "sub" will only replace the first occurrence of the pattern, whereas > "gsub" will replace all occurrences of the pattern in that string. > > - Dimitri Thanks, Dimitri. Actually, I figured that out on the way home--the "sub" versus "gsub." There are some things I have managed to get out my $40 book! -- Posted via http://www.ruby-forum.com/.