如何在 C# 中对二维数组进行排序
我已经查看了这个问题的其他答案,但他们并没有完全满足我的需要。
数组是variable height * 5 across
该数组包含字符串
我需要根据任一列对数组进行排序,例如按字母顺序对第三列进行排序,但是必须更新所有其他列。
有谁知道快速简便的解决方案?
我的代码一团糟,这是一个缩短的版本:
string[,] tmp = new string[2, 3];//this is filled with strings
string y = Console.ReadLine();
int x = Convert.ToInt32(y);
// sort tmp based on x column