I have a string array like this:
string[] names = new string[] { "john", "paul", "ringo", "george", "janis" };
I want to sort this array using a custom criteria. It can't be alphabetical. It might be in this order: pgrj.
I've tried to implement a new IComparer, but inside the Compare() method I can't use string.Compare cause it would sort alphabetically and I don't want to do that.
The question is: How can I sort the names array in this order: pgrj ? In the 'j' case. Janis might be before John.
Thanks.