Making a List in C# with three flexible elements in one datatype

If you really don’t want to create a class, you can use tuples, they are not that complex.

List<Tuple<string,string,string>> items 
= new List<Tuple<string, string, string>>(){ Tuple.Create("a","b","c")};

items.Add(Tuple.Create("1","2","3"));
items.Add(Tuple.Create("4","5","6"));

Leave a Comment