Freigeben über


Declarations.IsMatch(String, Int32) Method

Definition

Determines whether the specified text matches some or all of the specified item.

public:
 virtual bool IsMatch(System::String ^ textSoFar, int index);
public:
 virtual bool IsMatch(Platform::String ^ textSoFar, int index);
 virtual bool IsMatch(std::wstring const & textSoFar, int index);
public virtual bool IsMatch (string textSoFar, int index);
abstract member IsMatch : string * int -> bool
override this.IsMatch : string * int -> bool
Public Overridable Function IsMatch (textSoFar As String, index As Integer) As Boolean

Parameters

textSoFar
String

[in] A string containing the text typed by the user and to be matched.

index
Int32

[in] The index of the item to compare against.

Returns

Returns true if the specified text is at the beginning of the specified item; otherwise, returns false.

Remarks

This method is typically called by the GetBestMatch method to help find the best match for the text typed by the user.

The base method does a case-insensitive compare (using the System.String.Compare method) between the given text and the name of the given list item (as returned from a call to the GetName method), returning true if the item in the list begins with or exactly matches the given text.

Applies to