Separate content and example (#22468)

* Separate content and example

* Fixed formatting
pull/23864/head^2
Vocaoson 2018-11-09 16:09:06 +07:00 committed by Manish Giri
parent 18bd15f99f
commit 52b2fd8b91
1 changed files with 2 additions and 0 deletions

View File

@ -9,11 +9,13 @@ The `foreach` loop executes a block of code for each item in a collection. The b
### Example
```csharp
// syntax
foreach (element in iterable-item)
{
// body of foreach loop
}
// sample code
List<string> Names = new List<string>{ "Jim", "Jane", "Jack" }
foreach(string name in Names)