From: David Alan Black Date: 2002-02-16T21:59:29+09:00 Subject: Re: String#delete! null chars? Hello -- On Sat, 16 Feb 2002, Michal Rokos wrote: > Interesting... (?) > > ------------------------------------ > irb(main):014:0> a > "Test\00000000000000000000000000000" > irb(main):015:0> a.delete("\0") > "Test00000000000000000000000000" > irb(main):016:0> a.delete("\00") > "Test00000000000000000000000000" > irb(main):017:0> a.delete("\000") > "Test00000000000000000000000000" > irb(main):018:0> a.delete("\0000") > "Test" > irb(main):019:0> a.delete("\00000") > "Test" I think the \ is looking for the following 1-3 chars, so your first three examples are all equivalent. Here's another case: irb(main):022:0> "\7" "\a" irb(main):023:0> "\07" "\a" irb(main):024:0> "\007" "\a" irb(main):025:0> "\007X" "\aX" Also: irb(main):028:0> "\79" "\a9" So then in the last two examples you're deleting \000 and '0' ('0' twice in the last example). David -- David Alan Black home: dblack@candle.superlink.net work: blackdav@shu.edu Web: http://pirate.shu.edu/~blackdav