Understanding continue in foreach statement

Amatya
Posted by Amatya under C# category on | Points: 40 | Views : 335
Understanding continue in foreach statement

var dnf = new List<string>() { "Dot", "Net", "Funda" };
foreach (string name in dnf )
{
if (name == "Funda")
{
continue;
}
Console.WriteLine(name);
}




Output will be-
Dot
Net


Thanks
Amatya

Comments or Responses

Login to post response