Hi,

Am Dienstag, 22. MÁ” 2005, 00:19:59 +0900 schrieb Robert Klemme:
> 
> "Christian Neukirchen" <chneukirchen / gmail.com> schrieb im Newsbeitrag
> news:m2mzsxvxyl.fsf / lilith.local...
> > "Robert Klemme" <bob.news / gmx.net> writes:
> >
> > > "Tom Counsell" <tamc2 / cam.ac.uk> schrieb im Newsbeitrag
> > > news:193f68dcbb7799e1110cab8eb7a02248 / cam.ac.uk...
> > >> Hello
> > >>
> > >> I'm a little confused and would appreciate your help.
> > >> I would like to remove any \ characters from a string
> > >> as well as some other characters.
> > >>
> > >
> > > You're abusing String#tr - this method is intended to
> > > replace single chars by other single chars.  That you
> > > can remove characters is a special case with empty
> > > replacement strings.  You really should be using gsub
> > > or gsub!:
> > >
> > >>> 'b\\c'.gsub /\\/, ''
> > > => "bc"
> >
> > String#delete exists.
> 
> Cool!  Wasn't aware of that.  Thx for the pointer!

String#delete will be called when tr's second parameter is
empty.

Bertram


String#delete will be called when tr's second parameter is
empty.

Bertram


-- 
Bertram Scharpf
Stuttgart, Deutschland/Germany
http://www.bertram-scharpf.de