4.29 STRNCMP
Use @STRNCMP
to compare two strings, up to a specified number of characters in each string. Trailing spaces are truncated before comparing the strings. The compare returns:
-
0 if the strings are equal.
-
-1 if the first string is less than the second string.
-
1 if the first string is greater than the second string.
Syntax
@STRNCMP (compare_data
,compare_data
,max_compare_length
)
Example
This example returns 0
, since the first two characters of both strings are equal.
result = @STRNCMP ("JOHNSON", "JONES", 2)