Question: How can I go about doing this so if the "if" statement is true, to skip the code below the foreach loop and to go on with the rest of the program

```
void()
{
    foreach()
    {
        if()
        {

        }
    }

    //code I want to skip if "if" statement is true

}

```

Answer: 
```
void()
{
     bool process = true;
     foreach()
     {
          if()
          {
              process = false;
              break;
          }
     }

     if (process)
     {
       //code I want to skip if "if" statement is true
     }

}

```
If the collection you are iterating through contains The IEnumerable Interface, You could use Any() with a Lambda!

```
int[] myArray = { 1, 2, 3 };

                if( myArray.Any((a) => a == 1) )
                {
                    return;
                }

```

It is read: if my array contains any value a where a is equal to 1, then return out of this function.

Plus if you want to make it harder to read, you can omit the curly braces/brackets.

```
if( myArray.Any((a) => a == 1) )
     return;

```