Skip to content

Instantly share code, notes, and snippets.

@dkalamari
Created May 23, 2013 06:53
Show Gist options
  • Save dkalamari/5633172 to your computer and use it in GitHub Desktop.
Save dkalamari/5633172 to your computer and use it in GitHub Desktop.
C# array custom sort
class ComparerGeneric : IComparer<Customer>
{
#region IComparer<Customer> Members
public int Compare(Customer x, Customer y)
{
return x.Name.CompareTo(y.Name);
}
#endregion
}
//USE
Array.Sort(array_to_sort, new ComparerGeneric());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment