Assuming I have the following list of tuples:
List<Tuple<string, string>>
{"Name", "xx"},{"Age", "25"},{"PostalCode", "12345"},{"Name", "yy"},{"Age", "30"},{"PostalCode", "67890"}
I want to split this list into multiple lists. Splitting criteria is Item1 == "Name"
Result should be following:
List 1:
{"Name", "xx"},{"Age", "25"},{"PostalCode", "12345"}
List 2:
{"Name", "yy"},{"Age", "30"},{"PostalCode", "67890"}
I have a solution where I note down the indexes of "Name" in the original list and create new lists by using the function GetRange. But there must be a better and faster way of doing this?
<string, string>or<string, int>how you keep them originally?