Gsub jocks - Do you have an example that does this?

I know I’ve been lazy not learning RegExp and gsub but I simply never
use it except for this one time.
I’ll be importing .csv records and sometimes they’ll be dirty with
characters like ( # " ) and I’d like to change these to a space.
I would be grateful for a simple example?
Thank you,
Kathleen

On Fri, Sep 5, 2008 at 9:14 AM, [email protected]
[email protected]wrote:

I know I’ve been lazy not learning RegExp and gsub but I simply never
use it except for this one time.
I’ll be importing .csv records and sometimes they’ll be dirty with
characters like ( # " ) and I’d like to change these to a space.
I would be grateful for a simple example?
Thank you,
Kathleen

line.gsub!(/[#"]/,’ ')

the start / and end / define the regex. [#"] means 'match any one of the
following: # and " ’

the gsub-bang (gsub!) method will change the contents of the line
variable.
If you’re more cautious do clean_line = line.gsub(…)


Tim