Merge pull request #26 from codewarrior0/natural-sort

Change natural comparer to respect negative numbers
This commit is contained in:
Justin Aquadro 2015-02-27 00:11:55 -05:00
commit 975c11d3d8

View file

@ -29,11 +29,11 @@ namespace NBTExplorer.Utility
}
string[] x1, y1;
if (!table.TryGetValue(x, out x1)) {
x1 = Regex.Split(x.Replace(" ", ""), "([0-9]+)");
x1 = Regex.Split(x.Replace(" ", ""), "(-?[0-9]+)");
table.Add(x, x1);
}
if (!table.TryGetValue(y, out y1)) {
y1 = Regex.Split(y.Replace(" ", ""), "([0-9]+)");
y1 = Regex.Split(y.Replace(" ", ""), "(-?[0-9]+)");
table.Add(y, y1);
}