Using LinQ
using System.Linq; string[] arr= {" ","a","b"," ","c"," ","d"," ","e","f"," "," "}. arr.Where( x => !string.IsNullOrWhiteSpace(x)).ToArray();
or depending on how you fill the array, you can do this before
string[] arr = stringToBeSplit.Split('/', StringSplitOptions.RemoveEmptyEntries);
then empty records will not be placed in your string array first
kamui source share