Is there any method which remove blank indexs from the array
e.g
string[] test={"1","","2","","3"};
in this case is there any metod available to remove blank index from the array using c#
at the end i want to get array in this format
test={"1","2","3"}; which mean two index remove from the array and finaly i got 3 index
I'am not wriing exact code for array this is hint which i want to do
解决方案
If you are using .NET 3.5+ you could use linq.
test = test.Where(x => !string.IsNullOrEmpty(x)).ToArray();