Made pretty and clarified (#22392)
* fixed indentations, added line breaks * split the 3 switch case output examples and specified in which situation they would be executed
This commit is contained in:
		@@ -13,11 +13,8 @@ In the first example, when the value of i is 3, the break statement is executed,
 | 
			
		||||
int[] array = { 1, 2, 3, 4, 5 };
 | 
			
		||||
for (int i = 0; i < array.Length; i++)
 | 
			
		||||
{
 | 
			
		||||
  if(i == 3)
 | 
			
		||||
  {
 | 
			
		||||
    break;
 | 
			
		||||
  }
 | 
			
		||||
	Console.WriteLine("Item on index {0} is {1}", i, array[i]);
 | 
			
		||||
    if(i == 3) break;
 | 
			
		||||
    Console.WriteLine("Item on index {0} is {1}", i, array[i]);
 | 
			
		||||
}
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
@@ -37,12 +34,15 @@ switch (exampleVariable)
 | 
			
		||||
        Console.WriteLine("case 1");
 | 
			
		||||
        Console.WriteLine("This only shows in example 1");
 | 
			
		||||
        break;
 | 
			
		||||
        
 | 
			
		||||
    case 2:
 | 
			
		||||
        Console.WriteLine("case 2");
 | 
			
		||||
        Console.WriteLine("This only shows in example 2");
 | 
			
		||||
	Console.WriteLine("This also only shows in example 2");
 | 
			
		||||
        Console.WriteLine("This also only shows in example 2");
 | 
			
		||||
        break;
 | 
			
		||||
        
 | 
			
		||||
	Console.WriteLine("This would not show anywhere, as it is after the break line and before the next case");
 | 
			
		||||
    
 | 
			
		||||
    default:
 | 
			
		||||
        Console.WriteLine("default");
 | 
			
		||||
        Console.WriteLine("This only shows in the Default Example");
 | 
			
		||||
@@ -52,15 +52,19 @@ switch (exampleVariable)
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
## Output:
 | 
			
		||||
#### Executed with `exampleVariable = 1`
 | 
			
		||||
```
 | 
			
		||||
> case 1
 | 
			
		||||
> This only shows in example 1
 | 
			
		||||
>
 | 
			
		||||
```
 | 
			
		||||
#### Executed with `exampleVariable = 2`
 | 
			
		||||
```
 | 
			
		||||
> case  2
 | 
			
		||||
> This only shows in example 2
 | 
			
		||||
> This also only shows in example 2
 | 
			
		||||
>
 | 
			
		||||
```
 | 
			
		||||
#### Executed with `exampleVariable = 3` or any other number
 | 
			
		||||
```
 | 
			
		||||
> default
 | 
			
		||||
> This only shows in the Default Example
 | 
			
		||||
>
 | 
			
		||||
```
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user