IEnumerableExtensionsForEachT Method (IEnumerableT, ActionT, Int32) |
Calls an action on each element of a sequence. The action takes two arguments: an element and the index of the 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, int> action
)
<ExtensionAttribute>
Public Shared Sub ForEach(Of T) (
sequence As IEnumerable(Of T),
action As Action(Of T, Integer)
)
public:
[ExtensionAttribute]
generic<typename T>
static void ForEach(
IEnumerable<T>^ sequence,
Action<T, int>^ action
)
[<ExtensionAttribute>]
static member ForEach :
sequence : IEnumerable<'T> *
action : Action<'T, int> -> unit
Parameters
- sequence
- Type: System.Collections.GenericIEnumerableT
the input sequence - action
- Type: SystemActionT, Int32
An action that takes an element and an index and returns nothing.
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