PdfPrep.com

Which code should you use?

You have the following code.

You need to remove all of the data from the myData list.

Which code should you use?
A . for (int i = 0; i <= myData.Count; i++)
myData.RemoveAt(i);
B . while (myData.Count ! = 0)
myData.RemoveAt(0);

C . foreach(string currentString in myData) myData.Remove(currentString);
D . for (int i = 0; i <= myData.Count; i++)
myData.RemoveAt(0);

Answer: B

Exit mobile version