Skip to content

String Comparison #60166

@zeeshan595

Description

@zeeshan595

What is the problem this feature will solve?

Currently in java script if you want to compare 2 strings ignoring case sensitivity. The general practice is to make everything lower case and then compare the strings.

What is the feature you are proposing to solve the problem?

I propose there should be a function that should be capable of comparing the strings ignoring case sensitivity. You could pass an option to the function to do this.

What alternatives have you considered?

I tried a pure js implementation just to test the theory but since toLower() === toLower() is running as Native C++.
toLower() === toLower() ends up being faster.

Here is a c# version of what I am talking about

bool areEqualIgnoreCase = string.Equals(str1, str2, StringComparison.OrdinalIgnoreCase); // true

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestIssues that request new features to be added to Node.js.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    Awaiting Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions