why the sort result is different with C#

mzfhhhh via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Jan 21 22:53:29 PST 2016


D code:
auto arr = ["b1=1", "b=2","a1=1", "a=2"];
writeln(arr.sort());

output:["a1=1", "a=2", "b1=1", "b=2"]

C# code:
var arr = new string[]{ "b1=1", "b=2", "a1=1", "a=2" };
Array.Sort(arr);

output:["a=2","a1=1","b=2","b1=1"]


More information about the Digitalmars-d-learn mailing list