Which code should you use?

Posted by: Pdfprep Category: 70-483 Tags: , ,

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

Leave a Reply

Your email address will not be published.