Sorry, I hope that no one will notice me about the question about noob, I do not yet have a C # ref> <
Is there a way to put an additional conditional statement inside the foreach loop, for example:
string[] giggles = new string[6] { "one", "two", "three", "four", "five", "Six" };
int i = 0;
foreach (string gig in giggles && i < 4)
{
lblDo.Text = gig;
i++;
}
This obviously doesn't work, but is there something similar I can use, or am I sticking to using the if / break statement in a loop? Thank!
source
share