You missed
()
,
If sBreadcrumb.Split(".").Count() > 1 Then
root = CInt(sBreadcrumb.Split(".")(1))
oPage = New SiteManagerPage(CInt(root), Nothing)
End If
Note that
Count()
extension method can be used with
IEnumerable
but Collection types there is
Count
property and for array types there is
Length
property.
Most collections have a Length or Count property that is more efficient.
When to use Count(). This extension method does have some good uses. If you use a LINQ query expression, or for some other reason have an IEnumerable instance, it is the best way to determine how many elements are present.
The Count method can be used with an argument of type Func. e.g.:
Dim greaterThanTwo As Integer = array.Count(Function(element) element > 2)