Go to:
Return value. Related commands. Examples.
Synopsis
strcmp <string> <string>
Compares its 2 string arguments and returns an integer less than,
equal to, or greater than 0, based upon whether the first argument
is lexicographically less than, equal to, or greater than the
second argument.
Return value
int
Related commands
match, gmatchExamples
string $s1="hello";
string $s2="goodbye";
int $compare = `strcmp $s1 $s2`;
// Result: 1 //
$compare = `strcmp $s2 $s1`;
// Result: -1 //
$compare = `strcmp "hello" $s1`;
// Result: 0 //