Separate content and example (#22468)
* Separate content and example * Fixed formattingpull/23864/head^2
parent
18bd15f99f
commit
52b2fd8b91
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue