c# – .NET中有什么可以获得文化特有的所有工作日的缩写吗?

前端之家收集整理的这篇文章主要介绍了c# – .NET中有什么可以获得文化特有的所有工作日的缩写吗?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我需要不同文化中的平日缩写.我已经用西班牙语(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系统上.

原文链接:https://www.f2er.com/csharp/97140.html

猜你在找的C#相关文章