From: Bertram Scharpf Date: 2009-10-31T04:20:39+09:00 Subject: Re: How do you get the tail end of a string? Hi, Am Samstag, 31. Okt 2009, 04:00:09 +0900 schrieb Michael W. Ryder: > Bertram Scharpf wrote: >> For my private use I wrote a suite of methods >> String#head >> String#tail > > Just out of curiosity, do your methods work in a case like: > a="123456" > index = 12 > puts a(-index, index) Sure they do. main:003> a = "123456" => "123456" main:004> a.head 5 => "12345" main:005> a.tail 5 => "23456" main:006> a.head 12 => "123456" main:007> a.tail 8 => "123456" I remember that I detected this effect just when I wrote them and that I decided against the a[-i,i] behaviour. Bertram -- Bertram Scharpf Stuttgart, Deutschland/Germany http://www.bertram-scharpf.de