currently i obtain the below result from the following C# line of code when in es-MX Culture
Thread.CurrentThread.CurrentCulture =
Thread.CurrentThr
first two Solutions works fine but what if we would like to extend this to any culture so i came up with this approach i change the current culture date time arrays into TitleCase
private void SetDateTimeFormatNames()
{
Thread.CurrentThread.CurrentCulture.DateTimeFormat.DayNames = ConvertoToTitleCase(Thread.CurrentThread.CurrentCulture.DateTimeFormat.DayNames);
Thread.CurrentThread.CurrentCulture.DateTimeFormat.MonthNames = ConvertoToTitleCase(Thread.CurrentThread.CurrentCulture.DateTimeFormat.MonthNames);
}
private string[] ConvertoToTitleCase(string[] arrayToConvert)
{
for (int i = 0; i < arrayToConvert.Length; i++)
{
arrayToConvert[i] = Thread.CurrentThread.CurrentCulture.TextInfo.ToTitleCase(arrayToConvert[i]);
}
return arrayToConvert;
}
how can this be improved with out the Loop?