How to split() a delimited string to a List

string.Split() returns an array – you can convert it to a list using ToList():

listStrLineElements = line.Split(',').ToList();

Note that you need to import System.Linq to access the .ToList() function.

Leave a Comment