C# how to access array info unknown type within object
<p>I have an object called SampleObject that holds an array of strings called StringArray. In order for me to access the first element in that array I need to write:</p>

<pre><code>((string[])(SampleObject))[0]
</code></pre>

<p>However if I were to not know the type of the array how would I be able to approach this?</p>

<pre><code>((SampleObject.GetType())(SampleObject))[0];
</code></pre>

<p>I tried something like this but it expects a method name.</p>

<p>Thanks.</p>
