Return Full Month Name From 3 Letter Month I have piece metaled this code together from multiple google searches and thanks to the function from the site mentioned in the code.  I am sure there are ways to optimize this for speed.  What do you guys suggest?

using System;
using System.Globalization;

public class Program
{
    public static void Main()
    {
        string shortmonth = "Mar";
        string num = GetMonthNumberFromAbbreviation(shortmonth);
        string monthname = CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(Convert.ToInt32(num));
        Console.WriteLine(monthname);
    }
    //https://blogs.msmvps.com/deborahk/converting-month-abbreviations-to-month-numbers/
    private static string GetMonthNumberFromAbbreviation(string mmm) 
    { 
       string[] monthAbbrev = 
          CultureInfo.CurrentCulture.DateTimeFormat.AbbreviatedMonthNames; 
       int index  = Array.IndexOf(monthAbbrev, mmm) + 1; 
       return index.ToString("0#"); 
    }
}
The following avoids assumptions about and/or the need to convert according to culture, by letting the tried-and-tested DateTime plumbing do the work.  Creating a translation map once at first instantiation of the class (the static constructor) is the best I can think of to optimise performance.

If you use it, don't forget to do error-checking - specifically the result of TryParse.

using System;
using System.Collections.Generic;

public class Program
{
  private static readonly Dictionary&lt;string, string&gt; MonthNameMap;
  //  Static constructor to build the translation dictionary once
  static Program()
  {
    MonthNameMap = new Dictionary&lt;string, string&gt;();
    //var months = new List&lt;string&gt;() { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };
    //foreach (var shortMonthString in months)
    //{
    //  DateTime.TryParse($"1 {shortMonthString} 2000", out var dt);
    //  MonthNameMap.Add(shortMonthString, dt.ToString("MMMM"));
    //}
    for (int i = 1; i &lt;= 12; i++)
    {
      DateTime.TryParse($"2000-{i}-25", out var dt);
      MonthNameMap.Add(dt.ToString("MMM"), dt.ToString("MMMM"));
    }
  }

  public static void Main()
  {
    foreach (var entry in MonthNameMap)
    {
      Console.WriteLine($"{entry.Key}: {entry.Value}");
    }
  }
}


Results:

Jan: January
Feb: February
Mar: March
Apr: April
May: May
Jun: June
Jul: July
Aug: August
Sep: September
Oct: October
Nov: November
Dec: December