IEnumerableExtensionsForEachT Method (IEnumerableT, ActionT) |
Calls an action on each element of a sequence. The action takes one argument: an element. It has no return value.
Namespace: Bio.UtilAssembly: Bio.Core (in Bio.Core.dll) Version: 2.0.0.1 (2.0.0.1)
Syntax public static void ForEach<T>(
this IEnumerable<T> sequence,
Action<T> action
)
<ExtensionAttribute>
Public Shared Sub ForEach(Of T) (
sequence As IEnumerable(Of T),
action As Action(Of T)
)
public:
[ExtensionAttribute]
generic<typename T>
static void ForEach(
IEnumerable<T>^ sequence,
Action<T>^ action
)
[<ExtensionAttribute>]
static member ForEach :
sequence : IEnumerable<'T> *
action : Action<'T> -> unit
Parameters
- sequence
- Type: System.Collections.GenericIEnumerableT
the input sequence - action
- Type: SystemActionT
An Action, that is, a delegate that takes one input and has no output.
Type Parameters
- T
- the type of the elements
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type
IEnumerableT. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).
See Also