I have a text file which is being read using File.ReadLines(filepath). It's filled with first and last names delimited using a :. Is there a way using LINQ in which I would be able to access the first and last name in the foreach loop for the returned datatype?
// john:doe
// david:smith
// michael:rogers
var Names = File.ReadLines(filepath)
.Select(line => line.Split(':'));
foreach (var list in Names)
listbox1.Items.Add(list); //(first name) before :
listbox2.Items.Add(list); //(last name) after :
ListBox?