Skip to content

M_CodeJam_Collections_ArrayExtensions_ForEach__1

andrewvk edited this page Mar 30, 2016 · 7 revisions

ArrayExtensions.ForEach(T) Method

[This is preliminary documentation and is subject to change.]

Performs the specified action on each element of the specified array.

Namespace: CodeJam.Collections
Assembly: CodeJam (in CodeJam.dll) Version: 1.0.0.0 (1.0.0.0)

Syntax

C#

public static void ForEach<T>(
	[NotNullAttribute] this T[] array,
	[NotNullAttribute][InstantHandleAttribute] Action<T> action
)

VB

<ExtensionAttribute>
Public Shared Sub ForEach(Of T) ( 
	<NotNullAttribute> array As T(),
	<NotNullAttribute><InstantHandleAttribute> action As Action(Of T)
)

F#

[<ExtensionAttribute>]
static member ForEach : 
        [<NotNullAttribute>] array : 'T[] * 
        [<NotNullAttribute>][<InstantHandleAttribute>] action : Action<'T> -> unit 

Parameters

 

array
Type: T[]
The one-dimensional, zero-based Array on whose elements the action is to be performed.
action
Type: System.Action(T)
The Action(T) to perform on each element of array.

Type Parameters

 

T
The type of the elements of the array.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type . 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).

Exceptions

 

Exception Condition
ArgumentNullException array is null.-or-action is null.

See Also

Reference

ArrayExtensions Class
CodeJam.Collections Namespace

Clone this wiki locally