You definitely may not change a collection in any way when using a foreach loop on it.
You can use a for loop and manage the index for yourself or make a copy of the collection and as you are looping the original, remove items from the copy that equal the item in the original.
In both cases it's not quite as clear or convenient :).