Skip to content

Case insensitive comparison through Quality of Life method String#=~(other : String) #14667

Open
@Sija

Description

Feature Request

I propose adding a new QoL method String#=~(other : String) with the implementation like below:

class String
  def =~(other : String, *, options : Unicode::CaseOptions = :none) : Bool
    compare(other, case_insensitive: true, options: options).zero?
  end
end

This IMO supplements String#=~(regex : Regex).

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions