Skip to content

M_CommandLine_Infrastructure_EnumerableExtensions_IndexOf__1

Moh.Hassan edited this page Oct 10, 2019 · 1 revision

EnumerableExtensions.IndexOf(TSource) Method

Namespace: CommandLine.Infrastructure
Assembly: CommandLine (in CommandLine.dll) Version: 0.0.0

Syntax

C#

public static int IndexOf<TSource>(
	this IEnumerable<TSource> source,
	Func<TSource, bool> predicate
)

VB

<ExtensionAttribute>
Public Shared Function IndexOf(Of TSource) ( 
	source As IEnumerable(Of TSource),
	predicate As Func(Of TSource, Boolean)
) As Integer

C++

public:
[ExtensionAttribute]
generic<typename TSource>
static int IndexOf(
	IEnumerable<TSource>^ source, 
	Func<TSource, bool>^ predicate
)

F#

[<ExtensionAttribute>]
static member IndexOf : 
        source : IEnumerable<'TSource> * 
        predicate : Func<'TSource, bool> -> int 

Parameters

 

source
Type: System.Collections.Generic.IEnumerable(TSource)
predicate
Type: System.Func(TSource, Boolean)

Type Parameters

 

TSource

Return Value

Type: Int32

Usage Note

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

Reference

EnumerableExtensions Class
CommandLine.Infrastructure Namespace

Clone this wiki locally