I have to fill a combobox with month in English: January, February, etc. I did it next way:
private string[] AmericanMonths
{
get
{
var arr = new string[12];
var americanCulture = new CultureInfo("en-US");
for (int i = 0; i < 12; i++)
{
arr[i] = new DateTime(2000, i + 1, 1).ToString("MMMM", americanCulture);
}
return arr;
}
}
comboMonth.Items.AddRange(AmericanMonths);
How do you think, what way is better (perfomance)?
Is there a way to convert an integer representing month number to it's name?