Question: How can I dynamically create an array in C#?

Answer: 
Ok so array initialisation gets me *every single time*. so I took 10 minutes to do this right.

```
    static void Main(string[] args)
    {
        String[] as1 = new String[] { "Static", "with", "initializer" };
        ShowArray("as1", as1);

        String[] as2 = new String[5];
        as2[0] = "Static";
        as2[2] = "with";
        as2[3] = "initial";
        as2[4] = "size";
        ShowArray("as2", as2);

        ArrayList al3 = new ArrayList();
        al3.Add("Dynamic");
        al3.Add("using");
        al3.Add("ArrayList");
        //wow! this is harder than it should be
        String[] as3 = (String[])al3.ToArray(typeof(string));
        ShowArray("as3", as3);

        List<string> gl4 = new List<string>();
        gl4.Add("Dynamic");
        gl4.Add("using");
        gl4.Add("generic");
        gl4.Add("list");
        //ahhhhhh generic lubberlyness :)
        String[] as4 = gl4.ToArray();   
        ShowArray("as4", as4);
    }

    private static void ShowArray(string msg, string[] x)
    {
        Console.WriteLine(msg);
        for(int i=0;i<x.Length;i++)
        {
            Console.WriteLine("item({0})={1}",i,x[i]);
        }
    }

```
Use generic List or ArrayList.