-
Notifications
You must be signed in to change notification settings - Fork 89
Lists and Iteration
NN--- edited this page Apr 18, 2012
·
6 revisions
- Category: Lists, Tuples and Options
- Description: This sample shows simple uses of 'Iter' and foreach operator
- Code 1:
using System.Console;
def data = ["Cats", "Dogs", "Mice", "Elephants"];
foreach (x in data)
WriteLine($"item: $x");
- Code 2:
using System.Console;
def data = ["Cats", "Dogs", "Mice", "Elephants"];
data.Iter(x => WriteLine($"item: $x"))
- Execution Result:
item: Cats
item: Dogs
item: Mice
item: Elephants
[Copyright ©](Terms of use, legal notice)