4
Answers

how to add a null list to list of list ?

diamond diamond

diamond diamond

11y
1.1k
1
Hi all,

I have a list its name is TP that may be a null or has data, and have a list of list vairable its name is history.
I want to add the TP list to history with help of a counter "winc".

int winc = 1;
 List<string > TP ;
        List <List<string> > history = new List <List<string>>()  ;


When I run the code below gives exception invalid index or arument "An ArgumentOutOfRangeException"
 history[winc-1].AddRange (TP.ToList ());
 winc++;

I slould say in first time my TP list is null and TP.count() is 0.
Please help 
Thanks
Answers (4)