Go to: Synopsis. Return value. Related. MEL examples.
strcmp string string
strcmp is NOT undoable, NOT queryable, and NOT editable.
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.int | Comparison value |
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 //