If it was a stable sort, you could use
someList.Sort( (a, b) => a.Bar.CompareTo(b.Bar) ); someList.Sort( (a, b) => a.Foo.CompareTo(b.Foo) );
But it's not. Another nice thing about Perl. (use sort qw( stable );, which is currently the default.) JavaScript also has a stable sort (at least since version 10 or EcmaScript 2019).
That said, I like C#. It's quite good at doing what Perl does well.
In reply to Re: Spoiled by Perl
by ikegami
in thread Spoiled by Perl
by afoken
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |