From: rringler@... Date: 2016-11-26T21:13:26+00:00 Subject: [ruby-core:78381] [Ruby trunk Feature#12786] String#casecmp? Issue #12786 has been updated by Ryan Ringler. Martin D��rst wrote: > I gave an implementation in Ruby, but can somebody provide an equivalent patch in C? The attached patch implements `#casecmp?` by calling `#casecmp` and checking whether the return value is zero. I think this provides a clean separation of concerns (keeping all the comparison logic in `#casecmp`.) ---------------------------------------- Feature #12786: String#casecmp? https://bugs.ruby-lang.org/issues/12786#change-61755 * Author: Ryan Ringler * Status: Feedback * Priority: Normal * Assignee: ---------------------------------------- Description I would find String#casecmp? convenience method handy. I don't believe I've ever called String#casecmp without chaining #zero? to the result. ```ruby 'abc'.casecmp?('ABC') #=> true 'abc'.casecmp?('DEF') #=> false ``` ---Files-------------------------------- string_casecmp_.patch (4.97 KB) -- https://bugs.ruby-lang.org/ Unsubscribe: