LIKE( ) Function

Example   See Also

Determines if a character expression matches another character expression.

Syntax

LIKE(cExpression1, cExpression2)

Returns

Logical

Arguments

cExpression1

Specifies the character expression that LIKE( ) compares with cExpression2. cExpression1 can contain the wildcards such as * and ?. The question mark (?) matches any single character in cExpression2 and the asterisk (*) matches any number of characters. You can mix any number of wildcards in any combination in cExpression1.

cExpression2

Specifies the character expression LIKE( ) compares with cExpression1. cExpression2 must match cExpression1 letter for letter in order for LIKE( ) to return true (.T.).

Remarks

LIKE( ) returns true (.T.) if cExpression1 matches cExpression2; otherwise, it returns false (.F.).

SET COMPATIBLE determines how LIKE( ) evaluates cExpression1 and cExpression2. If SET COMPATIBLE is set to ON or DB4, cExpression1 and cExpression2 have all trailing blanks removed before they are compared. If SET COMPATIBLE is set to OFF or FOXPLUS, any trailing blanks in cExpression1 and cExpression2 are used in the comparison.