From: Dimitri Aivaliotis Date: 2006-04-07T04:17:44+09:00 Subject: Re: Basic input/output question Hi Peter, On 4/6/06, Peter Bailey wrote: > I kind of did what you had here, just a bit simpler: > line.gsub(/Microsoft/, "Apple") Here's where you need a ! -> that line should read: line.gsub!(/Microsoft/,"Apple") (See James' example.) The "gsub" will act on "line", and return a new object. On the other hand, the "gsub!" will change the "line" itself, without creating a new object. This is what you want in this case. In general, when there's an exclamation point version of a method, it will change the object itself, instead of returning a new, changed object. - Dimitri