我有以下要排序的字符串(字符串格式:121030-1833 --> YYDDMM-HHMM)
字符串示例:
121030-1833
120823-2034
120807-2014
120627-2316
120525-1136
111226-1844
我想将它们从最新格式排序到旧格式。
哪种排序方法最适合在这里使用?
更新的问题陈述
字典[String,string] "dictLocation" 值,想根据字典的键(键-YYMMDD-HHMM,从最新到最旧)对字典进行排序
{[110901-1226, sandyslocation.110901-1226]}
{[120823-2034, andyslocatio.120823-2034]}
{[110915-1720, mylocation.110915-1720]}
{[121030-1833, mylocation.121030-1833]}
我正在尝试这个 var latestToOldest = dictLocation.OrderBy(key => key.Key)
它没有给我正确的结果,我有什么遗漏吗?