Robert Dober wrote:
> 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
> 
> 
Your solution is about the same as the solution I found "clumsy".  I can 
use a.tr to remove multiple different characters such as: a ="This is a 
test, this is only a test!". a.tr(",!", "") will remove the comma and 
exclamation mark.  So why can't I use the same method to remove the 
comma and replace the exclamation mark with a period?  I know that there 
are escape codes for things like tabs and new-lines, so I was wondering 
if there was one for a null character.