Am trying to get values from a text file in which entries are delimited using ‘|‘.am getting the values using string .Split method..but in some places the delimiter appears multiple times in succession like ‘||||||||‘,so empty space gets inserted in the array how should i remove those empty elements from array or is there any efficient technique to read values from text file delimited by ‘|”.below is my code and the screen shot of array values
var reader = new StreamReader(File.OpenRead(@"d:\er.txt"));
while (!reader.EndOfStream)
{
var line = reader.ReadLine().Trim();
var values = line.Split('|');
string[] ee = values;
}

can any one suggest a better method for reading data from text file delimited by ‘|’
Splithas an overload that takes aStringSplitOptionsenumeration value:This will remove empty entries.