Use own IComparer with Linq OrderBy
Your comparer looks wrong to me. You’re still just sorting in the default text ordering. Surely you want to be parsing the two numbers and sorting based on that: public int Compare(Object stringA, Object stringB) { string[] valueA = stringA.ToString().Split(“https://stackoverflow.com/”); string[] valueB = stringB.ToString().Split(“https://stackoverflow.com/”); if (valueA.Length != 2 || valueB.Length != 2) { stringA.ToString().CompareTo(stringB.ToString()); } … Read more