From: Peter Booth Date: 2009-08-17T13:29:29+09:00 Subject: Re: start_with? Does someone need a grammar lesson? --Apple-Mail-1--554258089 Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit You can fix the English grammar in a number of ways. For example: define a function does does mystring.start_with?("bad grammar") or, even worse, rename your variable if my_characters.start_with?("good grammar") # i'm choosing grammatical correctness by breaking the semantics Remember, "A foolish consistency is the hobgoblin of little minds, adored by little statesmen and philosophers and divines." English grammar is sufficiently arbitrary, and fluid, to be a poor indicator of programming language quality. Peter On Aug 16, 2009, at 11:49 PM, 7stud -- wrote: > String#start_with?------------------------------- > > str.start_with?([prefix]+) => true or false > > From Ruby 1.9.1 > ------------------------------------------------ > Returns true if _str_ starts with the prefix given. > > > Whoever wrote the docs doesn't: > > Returns true if _str_ **starts with** the prefix given. I find it so > jarring to read: > > if mystring.start_with?("bad grammar") > > I'm hesitant to use start_with?() in my code. It makes me look > uneducated. :( > -- > Posted via http://www.ruby-forum.com/. > --Apple-Mail-1--554258089--