how to exit a method from a for loop c# code example
Example: c# exit for
Use "break;"
for (int i = 1; i <= 100; i++)
{
if (i == 5)
{
break;
}
}
Use "break;"
for (int i = 1; i <= 100; i++)
{
if (i == 5)
{
break;
}
}