From: "Brian Schröder" Date: 2005-10-02T09:13:22+09:00 Subject: Re: suggested changes for ruby libraries On 02/10/05, Austin Ziegler wrote: > On 10/1/05, Martin DeMello wrote: > > Austin Ziegler wrote: > > > str.index(find) + (find.size - 1) > > Same thing. It's still asking the user to do something that is more > > properly the computer's problem (explicitly specifying an algorithm for > > a common task), and it's repeating a piece of information in the "call". > > Fair enough; I don't think that adding a boolean-style parameter is a > good idea, though. I'd support an #index_of_last or something like > that. > > -austin Wouldn't this be too small a function to include into the stdlib? Why not simply include class String def index_of_last(needle) self.index(needle) + (needle.size - 1) end end in your program or your personal lib. Or maybe ask for inclusion in nano. But I admit its difficult to draw the line here. What is your opinion? best regards, Brian -- http://ruby.brian-schroeder.de/ Stringed instrument chords: http://chordlist.brian-schroeder.de/