Skip to content

Incorrect sort of leading zeros within an alphanumeric value #24

@Mottie

Description

@Mottie

The result of this array is incorrect:

["a55", "a010", "a102", "a02", "a1", "a255", "a33", "a43", "a87"].sort( naturalSort );
// result : ["a010", "a02", "a1", "a33", "a43", "a55", "a87", "a102", "a255"]

My feeble attempts at fixing this problem caused the failure of a few other unit tests.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions