From: "Bermejo, Rodrigo" Date: 2003-11-15T10:24:42+09:00 Subject: Re: substring: to the end of the string class String def substring /(^...)(.*)\z/ =~ self return $2 end end "123456".substring = >"456" Now...... I am just wondering how can I build dinamically the Regexp I mean ... "123456".substring(5) = > "6" "123456".substring(4) = > "56" ideas ? -r. KONTRA Gergely wrote: >Hi! > >Is there any easiest way to get the substring starting from the 3rd >character? > >my solution: >str[3..-1] which seems quite odd :-/ > >What if, intuitive, we can write >str[3..]? > >Any smarter solution? > >Gergo > > -- General Electric - CIAT Advanced Engineering Center ________________________________________ Rodrigo Bermejo Information Technologies. Special Applications Dial-comm : *879-0644 Phone :(+52) 442-196-0644