Issue #12786 has been updated by Ryan Ringler.


Nobuyoshi Nakada wrote:
> `String#casecmp` also should have those options, I think.

I agree, and feel strongly that the logic to support those options should live there.  Someone smarter than I should probably make the changes Martin has suggested to `String#casecmp`; I just want a predicate method that indicates whether `String#casecmp` indicates a match or not.

----------------------------------------
Feature #12786: String#casecmp?
https://bugs.ruby-lang.org/issues/12786#change-61758

* 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: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>