You need to sign in to do that
Don't have an account?

List<list<String> Apex Salesforce
Hi any anyone explain me the concept of 2 array using list<list<String>>.
How to access individual elements of both the list.
if suppose i have
List<List<String>> HeaderDataC = new List<List<String>>();
List<String> list1 = new List<String>();
List<String> list2 = new List<String>();
list1.add('val1');
list1.add('val2');
list2.add('1');
list2.add('2');
HeaderDataC.add(list1);
HeaderDataC.add(list2);
but here what represents row data n what represents column data.
and if suppose i wana insert value in specific row of specific column,how do i achive it?
like HeaderDataC[2][3]?
Thanks in advance.
Expains a lot about the same
All Answers
Expains a lot about the same
List<String> OneListOfAllStrings = new List<String>();
For(List<String> IndividualList : ListOfListHere){
OneListOfAllStrings.addAll(IndividualList);
}
Iterate each list from ListOfListHere and add to the list to which you are trying to copy values using for loop.