strcmp, strcmpi - compare strings

SYNOPSIS

<strcmp $a $b [$mode]>
<strcmpi $a $b [$mode]>


DESCRIPTION
The strcmp function compares every value of $a against every value of $b as a string. For each comparison, an integer value is returned:

  • < 0 if $a < $b

  • 0 if $a = $b

  • > 0 if $a > $b

The optional $mode argument is a stringcomparemode-style (here) compare mode to use; the default is the current apicp stringcomparemode, with "ignorecase" added for strcmpi. The $mode values are used in the same order as $b values. The $mode argument was added in version 6.


DIAGNOSTICS
strcmp and strcmpi return A*B integer values (A and B being the number of values of $a and $b).


EXAMPLE

<strcmpi "This" "this">

The return value in $ret would be 0.


CAVEATS
Text is compared according to apicp stringcomparemode (with "ignorecase" for strcmpi) or the $mode argument.


SEE ALSO
strncmp, strnicmp, strfoldcmp


Copyright © Thunderstone Software     Last updated: Oct 24 2023
Copyright © 2024 Thunderstone Software LLC. All rights reserved.