The following lines are added to the List<string> : 1|Александр|Иванов
How each text through the separator | write to a separate variable? This miracle must be implemented in a loop, because there are many such lines.
Or tell me, please, what can I replace? I think the description is clear what I need.
Or maybe you can even directly implement what I need? In short, give an example with the line above. 1 is a unique number ( ID ), I need to get a first and last name by ID .
Person(and, possibly, aDictionaryfor a quick search). However, I suggest going further and removingList<string>altogether. There must be a collection of instances ofPerson. And for storing in a file (that's probably where your lines come from) this collection should be serialized into JSON or XML. - Alexander Petrov