StrComp()

Top  Previous  Next

StrComp() - Compare two strings

Description

The StrComp() function compares two strings and returns whether they are equal or not.

StrComp(string1, string2[, [id=43]compare[/id]])

Returns "0" if strings match, "-1" if string1 < string2, or "1" if string1 > string2.

Example

StrComp("hello", "hello") 'returns 0

 

StrComp("hello", "heelloo") 'returns 1

 

StrComp("heelloo", "hello") 'returns -1