From: Robert Dober Date: 2007-05-03T13:42:33+09:00 Subject: Re: Question regarding tr method in Strings Class On 5/3/07, Michael W. Ryder <_mwryder@worldnet.att.net> wrote: > Is there a way to denote a null in the replacement for a character using > this method? For example, if I have a = "Jones,Ja'me" and I want to > convert the comma to a space and remove the apostrophe without placing a > character in there. I know I can use a.tr(",", " ").tr("'", "") to get > the desired result but would prefer to be able to say something like > a.tr(",'", " ") and have it remove the apostrophe and replace the comma > in one step. Besides, if I am going to be removing a lot of punctuation > the string could get very long and complicated. > I do not think this works but why not use the "right" tool for each task tr(","," ").gsub(/'/,"") does not look too clumsy to me ;) Cheers Robert -- You see things; and you say Why? But I dream things that never were; and I say Why not? -- George Bernard Shaw