STRSAME function

Microsoft Office ShapeSheet

STRSAME function

Determines whether strings are the same. It returns TRUE if they are the same and FALSE if they aren't. To compare multi-byte strings or to do comparisons using case rules for a specific locale use the STRSAMEEX function.

Syntax

STRSAME ("string1", "string2", ignoreCase)

string1

The first string to compare.

string2

The second string to compare.

ignoreCase

Optional. A Boolean variable. TRUE to ignore the case and FALSE to compare the case. The default is FALSE.

Example 1

STRSAME("cat","dog")

Returns FALSE.

Example 2

STRSAME("cat","cat")

Returns TRUE.

Example 3

STRSAME("cat","cat", TRUE)

Returns TRUE.

Example 4

STRSAME("cat","CAT")

Returns FALSE.

Example 5

STRSAME("cat","CAT", TRUE)

Returns TRUE.

Example 6

STRSAME("cät","CAT", TRUE)

Returns FALSE.

Example 7

STRSAME("cät","CÄT", TRUE)

Returns TRUE.