Assigning unassigned string to array
<p>I've got a function which takes a ArrayList and loads it with strings along the line of</p>

<pre><code>void func( ref ArrayList data )
{
    if( data[0].GetType() == typeof(String) )
        data[0] = "Jimmy";
}
</code></pre>

<p>In the function that calls func() I am having to create strings to put in the array:</p>

<pre><code>ArrayList data = new ArrayList(1);
string str = "";
data.Add(str);
</code></pre>

<p>Is it possible to give the ArrayList the object types without having to create an object of that type? This:</p>

<pre><code>ArrayList data = new ArrayList(1);
string str;
data.Add(str);
</code></pre>

<p>Gives a "Use of unassigned local variable 'str'" error.</p>

<p>@James and Guffa: Thanks for the 'stylistic' hints, I'm new to c# and the advice is much appreciated</p>
