共用方式為


SPUtility.BinarySearchWithFallback<T> method

一般物件的執行二進位搜尋的清單。如果清單中找不到物件,此方法會在一般物件應該要插入的清單中找到的以零為起始的索引位置。

Namespace:  Microsoft.SharePoint.Utilities
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

Syntax

'宣告
Public Shared Function BinarySearchWithFallback(Of T) ( _
    lst As IList(Of T), _
    t As T, _
    comparer As IComparer, _
    <OutAttribute> ByRef found As Boolean _
) As Integer
'用途
Dim lst As IList(Of T)
Dim t As T
Dim comparer As IComparer
Dim found As Boolean
Dim returnValue As Integer

returnValue = SPUtility.BinarySearchWithFallback(lst, _
    t, comparer, found)
public static int BinarySearchWithFallback<T>(
    IList<T> lst,
    T t,
    IComparer comparer,
    out bool found
)

Type parameters

  • T
    位置是要找的一般物件的類型。

參數

  • t
    Type: T

    若要將位於物件。

  • found
    Type: System.Boolean

    true表示一般物件找 ;否則false。

傳回值

Type: System.Int32
代表 [] 清單中之物件的索引位置的 32 位元整數或,如果物件找不到,物件應插入清單的索引位置。

請參閱

參照

SPUtility class

SPUtility members

Microsoft.SharePoint.Utilities namespace