Removes line in List gives exeptions

I got a strange behaviour in a list so I’d like to see what’s wrong:
I got a List of strings and it’s copy,
let’s say that in the original list i’ve got elements like [“foo”,“”,“bar”,“”,]
my goal is to get a copy of this list whitout the “” elements (empty strings)

So I do like this

List tempTab;
tempTab = new List ();
//here copies the main list
// currently got ["","","","","","","","","","","foo"]
tempTab = GameVars.gamevars.entities [displayedPlayer].classCardsLocked;
print (tempTab.Count); //gives 10
//loop the created table and removes the ""
for (int i=tempTab.Count; i>0; i--) {
if (tempTab*=="")* 

tempTab.RemoveAt(i); //here’s the error ArgumentOutOfRangeException: Argument is out of range.

I did the loop backwards, because if i remove elements by starting at index 0, I’ll get the wrong tab.Count() and it’ll never get to the end of the List
But this throws an out of range exception . What’s wrong?

Im not sure if ur familiar with Linq, but you could use it to alter a list:

using System.Linq;
var noEmpty = tempTab.Where(x => x != "");