Last post Sep 15, 2018 12:25 PM by KathyW
Sep 13, 2018 09:04 PM|mmazeemahmad|LINK
I am looking to store my data that is not in a fixed format in an array or list but as array is of fixed size so cant use that, list provides flexibility but it doesnt comes with multi dimensions option like array does..
I had a data like:
"Acids", "A1", "A2", "A3" - this could grow to ph4 till ph 10 depends
"Sulphur" "S1", "S2", - this could grow to ph4 till ph 0 depends
"Carbon" "c1", C2" can grow depends
also after storing it in the list i also need to retrieve in a way that in a loop i should get first Acids then all its sub components that is A1, A2, A3, once done then move to Sulphur and get its corresponding components.
Please can anyone suggest anything on how to best deal with this.
Sep 14, 2018 01:09 AM|mgebhard|LINK
Sep 15, 2018 12:25 PM|KathyW|LINK
One option is to create a list of lists. An example here:
https://www.dotnetperls.com/nested-list The example uses List<List<int>> and populates it with random numbers. You'd use List<List<string>> and populate it with your string values.