Purpose
Returns TRUE or FALSE to indicate whether a string satisfies pattern-matching criteria. You can call this function from the MapBasic window in MapInfo Pro.
Syntax
Like( string, pattern_string, escape_char )
string is a string expression to test.
pattern_string is a string that contains regular characters or special wild-card characters.
escape_char is a string expression defining an escape character. Use an escape character (for example, "\") if you need to test for the presence of one of the wild-card characters ("%" and "_") in the string expression. If no escape character is desired, use an empty string ("").
Return Value
Logical value (TRUE if string matches pattern_string).
Description
The Like() function performs string pattern-matching. This string comparison is case-sensitive; to perform a comparison that is case-insensitive, use the Like operator.
The pattern_string parameter can contain the following wildcard characters:
_ (underscore) | matches a single character. |
% (percent) | matches zero or more characters. |
To search for instances of the underscore or percent characters, specify an escape_char parameter, as shown in the table below.
To determine if a string... | Specify these parameters: |
---|---|
starts with "South" |
|
ends with "America" |
|
contains "ing" at any point |
|
starts with an underscore |
|
See Also:
Len() function, StringCompare() function