代码: using System; using System.Collections.Generic; publicclassMyClass { publicstaticvoidMain() { List<string> names =newList<string>(){"ccc","xxx","aaa","bbbb"}; names.Sort(); var result =String.Join(&q
我们经常会遇到对时间进行转换,达到不同的显示效果,默认格式为:2006-6-6 14:33:34,如果要换成200606,06-2006,2006-6-6或更多的格式该怎么办呢?这里将要用到:DateTime.ToString的方法. 一.DateTime.ToString格式模式 下面列出了DateTime.ToString(string format) 中 format 参数.这些模式是区分大小写的:例如,识别“MM”,但不识别“mm”. d 月中的某一天.一位数的日期没