From: Dave Thomas Date: 2002-04-02T00:40:50+09:00 Subject: Re: String#begins?(s) matz@ruby-lang.org (Yukihiro Matsumoto) writes: > Hi, > > In message "Re: String#begins?(s)" > on 02/04/01, Helmut Leitner writes: > > |Would you like > | "head?" > | "tail?" > |? > > I like them, but I'm not sure whether they're clear or not. If I saw just plain 'head' or 'tail', I'd assume they returned the first element and the remaining elements from a list. When applied to strings, I guess I'd assume the first character and the remaining characters. I'd therefore be surprised to see a '?' variant that took a parameter, and that looked at multiple characters: a = "hello" a.head #=> 'a' (in my mind) a.head?("he") #=> impedance mismatch I'm not convinced we need the methods, but if we do, I think #starts_with and #ends_with are good candidates for names. Dave