Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Three-way comparison function for strings #364

Open
Labels
ideaProposition of an idea and opening an issue to discuss it topic: stringsString processing
@ChetanKarwa

Description

I went through the stdlib_string_type module and I want to recommend some changes. Correct me if I am wrong at any point.

  • The lgt, llt, lge and lle work very similarly to the operators >, <, >=, <= respectively according to me there is not much need for all these functions.
  • Instead of all these we can have a general function compare(str1,str2) this function will return an integer value:
    • 1 if str1 is lexicographically greater than str2,
    • 0 if str1 is lexicographically equal to str2,
    • -1 if str1 is lexicographically smaller than str2.
  • We can also include a function like compare_ignore_case(str1,str2) this function is similar to compare but is not case sensitive. (can improve nomenclature of the functions)

Metadata

Metadata

Assignees

No one assigned

    Labels

    ideaProposition of an idea and opening an issue to discuss it topic: stringsString processing

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /