From: "Michael W. Ryder" <_mwryder@...> Date: 2007-05-04T04:05:21+09:00 Subject: Re: Question regarding tr method in Strings Class Robert Dober wrote: > On 5/3/07, Michael W. Ryder <_mwryder@worldnet.att.net> wrote: > >> Your solution is about the same as the solution I found "clumsy". > You are not coming from a Unix background, are you? We are used to > pasting things together like that, but I respect your taste. > > 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. > I understood that you wanted to delete a character not to replace it > with a null character, which should be possible via \000. But I fail > to see the purpose of this in the context of your question. > Robert >> >> > > I find your sig very appropriate. I can find several ways to clean up a string using two or more operations, I was just looking to see if there was not also a way to do the same thing with one operation. In some ways Ruby is far easier to use than the language I have been using for over 25 years, but there are other places it is much harder. I am doing a lot of experimenting to find out the best way for me to do things and this is the latest experiment.