Edit

Share via


StringType.StrLike(String, String, CompareMethod) Method

Definition

Compares the parameters Source and Pattern and returns the same results as the Like operator.

This API supports the product infrastructure and is not intended to be used directly from your code.

public:
 static bool StrLike(System::String ^ Source, System::String ^ Pattern, Microsoft::VisualBasic::CompareMethod CompareOption);
public static bool StrLike (string? Source, string? Pattern, Microsoft.VisualBasic.CompareMethod CompareOption);
public static bool StrLike (string Source, string Pattern, Microsoft.VisualBasic.CompareMethod CompareOption);
static member StrLike : string * string * Microsoft.VisualBasic.CompareMethod -> bool
Public Shared Function StrLike (Source As String, Pattern As String, CompareOption As CompareMethod) As Boolean
Public Function StrLike (Source As String, Pattern As String, CompareOption As CompareMethod) As Boolean

Parameters

Source
String

Required. Any String expression.

Pattern
String

Any String expression conforming to the pattern-matching conventions described in Like Operator.

CompareOption
CompareMethod

Specifies how to compare strings to patterns, according to the CompareMethod. Can be vbBinaryCompare for binary comparison or vbTextCompare for comparison based on a case-insensitive text sort order determined by your system's LocaleID value.

Returns

A Boolean value indicating whether or not the string satisfies the pattern. If the value in string satisfies the pattern contained in pattern, result is True. If the string does not satisfy the pattern, result is False. If both string and pattern are empty strings, the result is True.

Remarks

This method compares the parameters Source and Pattern and returns the same results as the Like Operator. The result is a Boolean value indicating whether or not the string satisfies the pattern.

Applies to