From: Matt Armstrong Date: 2002-04-01T23:54:51+09:00 Subject: Re: String#begins?(s) Michael Brailsford writes: >> class String >> def begins?(s) >> self[0...(s.size)] == s >> end >> end >> >> Worthwhile? > > Maybe I am missing the point, but why do you need something like > this? If you want to know the first char in a string just use > something like aString[0] == aChar. If you want to know if a > sequence starts a string use regex's. I agree. I can imagine the RCR. Can we make String#begin? take a regexp? So "foo".begin?(/f/) would be just like "foo" =~ /\Af/? -- matt