3
Answers

add values to list in a loop

darma teja

darma teja

11y
1.2k
1
Hi,

my problem is:

In every loop i get 3 values (logic to get strings) and store it into customer. With the following code I am getting only my 5th loop values in my final customer list.

List<string> customer = new List<string>();

for (int i = 0; i < 5; i++ )
{
customer= logic to get values (here I get 3 strings)
}

Thanks allot

Darma
Answers (3)