Nick is correct, if you are removing item you should start at the end and work forwards. Imagine your index is zero, the item at index zero is all spaces so you remove it. The items in the collection will then move down into the space so item one becomes item zero...but you have already tested zero so you increment your index and test item at index one. If the item that was originally at index one was all spaces it wont be removed. Every time you remove an item you skip one. By starting at the last item and moving to the first you avoid that problem.
This is the reason you get an exception if you alter a collection inside a foreach loop :)
Just a note, you are checking for:
what happens if the item contains
You can use trim to clear of the excess white space then check for empty strings:
Write a C program that should create a 10 element array of random integers (0 to 9). The program should total all of the numbers in the odd positions of the array and compare them with the total of the numbers in the even positions of the array and indicate ...
I have a 2d matrix with dimension (3, n) called A, I want to calculate the normalization and cross product of two arrays (b,z) (see the code please) for each column (for the first column, then the second one and so on).
the function that I created to find the ...