StrEqual Function

Syntax

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

Arguments

Result_Flag

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

String1

A character string.

String2

A character string.

IgnoreWhiteSpace

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

CaseSensitive

Logical. Default = .F. .T. = Ignore character case when making the comparison, .F. = Do not ignore character case

Description

Returns .t. 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.)
= .F.
? strequal(string1, string2, .F., .T.)
= .F.
? strequal(string1, string2, .T., .T.)
= .T.

Limitations

Desktop applications only.

See Also