From: Michael Guterl Date: 2006-08-11T03:52:35+09:00 Subject: Re: Method arguments. ------=_Part_33840_7233365.1155235841337 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline On 8/10/06, Sard Aukary wrote: > > Jim Weirich wrote: > > In your particular case, it can be restated as: > > > > puts "this is a test"[4..-1] > > > > Where the -1 refers to the end of the string. > > > > I'm not sure how your example relates to function arguments ... but is > > this helpfull? > > > > -- Jim Weirich > > Ah yes, -1 is the most obvious way of to get the end reference. > > I was just wondering if there was some sort of reflective way of getting > a reference to the "this is a test" string from with the [] method. Are you looking for something like this? class String def your_method self[4..self.length] end end "this is a test".your_method => " is a test" Thanks. > > -- > Posted via http://www.ruby-forum.com/. > > Michael Guterl ------=_Part_33840_7233365.1155235841337--