我需要不同文化中的平日缩写.我已经用西班牙语(hardcoded)了.在.NET中有没有已经有的东西?
//string[] days = { "lunes","martes","miércoles","jeuves","viernes","sábado","domingo" }; string[] days = { "L","M","X","J","V","S","D" };
解决方法
你可能正在寻找
DateTimeFormatInfo.AbbreviatedDayNames
Gets or sets a one-dimensional array of type String containing the culture-specific abbreviated names of the days of the week.
或DateTimeFormatInfo.ShortestDayNames
Gets or sets a string array of the shortest unique abbreviated day names associated with the current DateTimeFormatInfo object.
例如:
CultureInfo.CurrentCulture.DateTimeFormat.AbbreviatedDayNames
回报
在de-de系统上.