natcmp 1.2.2

Compare strings in a human-natural way.


To use this package, put the following dependency into your project's dependencies section:

dub.json
dub.sdl

Natcmp - A D library for comparing strings and paths in a human-natural way.

Supported platforms

  • Any with D compilers

Example usage

assert(array(sort!compareNaturalSort(["0", "10", "1"])) == ["0", "1", "10"]);
assert(array(sort!compareNaturalSort(["a", "c", "b"])) == ["a", "b", "c"]);
assert(array(sort!compareNaturalSort(["a1", "a"])) == ["a", "a1"]);

assert(array(sort!comparePathsNaturalSort(["a/b/c", "a/b/e", "a/b/d"])) == ["a/b/c", "a/b/d", "a/b/e"]);
assert(array(sort!comparePathsNaturalSort(["a1", "a"])) == ["a", "a1"]);
assert(array(sort!comparePathsNaturalSort(["a1/b", "a/b"])) == ["a/b", "a1/b"]);
Authors:
  • Cameron "Herringway" Ross
Dependencies:
none
Versions:
1.3.2 2016-Nov-05
1.3.1 2016-Feb-19
1.3.0 2016-Jan-23
1.2.3 2015-Aug-26
1.2.2 2014-Oct-11
Show all 9 versions
Download Stats:
  • 0 downloads today

  • 10 downloads this week

  • 31 downloads this month

  • 1230 downloads total

Score:
1.3
Short URL:
natcmp.dub.pm