StartsWithExtension.StartsWith<T> Method (IEnumerable<T>, IEnumerable<T>) |
Determines whether the beginning of the first sequence is
equivalent to the second sequence, using the default equality
comparer.
Namespace:
MoreLinq.Extensions
Assembly:
MoreLinq (in MoreLinq.dll) Version: 3.3.1+b77df70598ab84c28cd43dcf74594024b6d575e1
Syntaxpublic static bool StartsWith<T>(
this IEnumerable<T> first,
IEnumerable<T> second
)
<ExtensionAttribute>
Public Shared Function StartsWith(Of T) (
first As IEnumerable(Of T),
second As IEnumerable(Of T)
) As Boolean
public:
[ExtensionAttribute]
generic<typename T>
static bool StartsWith(
IEnumerable<T>^ first,
IEnumerable<T>^ second
)
[<ExtensionAttribute>]
static member StartsWith :
first : IEnumerable<'T> *
second : IEnumerable<'T> -> bool
Parameters
- first
- Type: System.Collections.Generic.IEnumerable<T>
The sequence to check. - second
- Type: System.Collections.Generic.IEnumerable<T>
The sequence to compare to.
Type Parameters
- T
- Type of elements.
Return Value
Type:
Booleantrue if
first begins with elements
equivalent to
second.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type
IEnumerable<T>. 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).
Remarks
This is the IEnumerable<T> equivalent of
StartsWith(String) and it calls
Equals(T, T) using
Default on pairs of elements at
the same index.
See Also