c# exit for

C#
Use "break;"
  
for (int i = 1; i <= 100; i++)
{
	if (i == 5)
	{
		break;
	}
}
Source

Also in C#: