Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一些像
“00:00:00”
“00:02:00”
“00:07:02”
像 AZ 一样对它进行排序的最佳方法是什么?
谢谢!!!
我猜数据类型是 a TimeSpan,在这种情况下你可以使用
TimeSpan
var sortedArray = myArray.OrderBy(TimeSpan.Parse);
我很懒所以我可能会这样:
string[] array = new string[] { "00:03:00", "00:00:00" }; Array.Sort(array);