EnumerableExtensionsTryGetCount(IEnumerable, Int32) Method
Tries to get the number of elements in the source enumeration without enumerating it.
Namespace: KGySoft.CoreLibrariesAssembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 9.0.0
public static bool TryGetCount(
this IEnumerable source,
out int count
)
<ExtensionAttribute>
Public Shared Function TryGetCount (
source As IEnumerable,
<OutAttribute> ByRef count As Integer
) As Boolean
public:
[ExtensionAttribute]
static bool TryGetCount(
IEnumerable^ source,
[OutAttribute] int% count
)
[<ExtensionAttribute>]
static member TryGetCount :
source : IEnumerable *
count : int byref -> bool
- source IEnumerable
- The source to check.
- count Int32
- If this method returns , then this parameter contains the number of elements in the source enumeration. This parameter is passed uninitialized.
Boolean, if the number of elements could be determined without enumeration; otherwise,
.In Visual Basic and C#, you can call this method as an instance method on any object of type
IEnumerable. 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).