How do I remove an empty element in an array?
<p>I have an array of email address, but an empty string gets injected into the end of the array. How can I remove this element in the array? </p>

<pre><code>for(int i = 0; i &lt; allToAddresses.Length; i++)
{
    if(allToAddresses[i] == " ") // find where empty element is
    { //Here i am trying to delete that empty element. does not work
       allToAddresses[i].Split("".ToCharArray(),StringSplitOptions.RemoveEmptyEntries);
    }
}
</code></pre>