StrEqual Function

Syntax

Result_Flag as L = STREQUAL(C String1, C String2 [,L IgnoreWhiteSpace = .f. [, L CaseSensitive = .f.]])

Arguments

String1Character

A character string.

String2Character

A character string to compare to String1.

IgnoreWhiteSpaceLogical

Default = .F.; .T. = Ignore white space characters when making the comparison, .F. = Do not ignore white space characters

CaseSensitiveLogical

Default = .F. .T. = Make a case-sensitive comparison, .F. = Make a case-insensitive comparison.

Returns

Result_FlagLogical

.T. = The strings match (are equal). .F. = The strings do not match.

Description

Returns true if the two strings are equivalent.

Discussion

The StrEqual() function compares the values contained in two character strings and returns .T. if they are equal, based on the selection of options.

Example

dim string1 as C
dim string2 as C
string1 = "Abc "
string2 = "abc"

? strequal(string1, string2)
= .F.

? strequal(string1, string2, .T.)
= .T.

? strequal(string1, string2, .F., .T.)
= .F.

? strequal(string1, string2, .T., .T.)
= .F.

Limitations

Desktop applications only.

See Also