remove element from list of strings?
<p>AH! I have a list of strings... and i just want to remove an element from the list if it is ""</p>

<p>but i keep causing the program to crash. How do i get around this? I made a list of arrays into a List of strings thinking i could remove it that way. Here is what i have:</p>

<pre><code>        List&lt;String&gt;list;

        String[] f= new String[file.length()];
        f= file.split("&lt;"); 

        list= Arrays.asList(f); 

        final Iterator&lt;String&gt; iter = list.iterator();
        while (iter.hasNext()) 
        {
            final String temp = iter.next();
            // TODO check for zero-length arrays
            if (temp.equals("")) 
            {
                iter.remove();
            }
        }
</code></pre>

<p>Error:</p>

<pre><code>Exception in thread "main" java.lang.UnsupportedOperationException
    at java.util.AbstractList.remove(Unknown Source)
        at java.util.AbstractList$Itr.remove(Unknown Source)
        at utilities.Validation.Validate(Validation.java:44)
</code></pre>

<p>After i convert it to a List, i can print the list just fine.. it's removing elements from it that becomes an problem...</p>
