Possible Duplicate:
continue and break with an extended scope
i have one problem. I don't know how to call continue for "for" inside foreach.
Code:
for(int i = 0; i < ...; i++)
{
foreach(´´ .. in ´´)
{
if(,,.Value == null)
// A!
}
}
And i need replace "A!" for code to continue "for"! Not foreach. I used basic continue but it work just only for foreach.
SOLVED with:
for(int i = 0; i < ...; i++)
{
bool Ab = false;
foreach(´´ .. in ´´)
{
if(,,.Value == null)
Ab = true;
}
if(Ab)
continue;
}
if you need to stop the inner loop, and continue the outer loop, you just need a break statement in the inner loop
for(int i = 0; i < ...; i++)
{
foreach(var thing in something)
{
if(thing.Value == null)
{
break;
}
}
}