Table of Contents

strcmp

Description

Compare two strings, as with the strcmp function in C.

Function prototype

int strcmp <string:str1> <string:str2>

Arguments

Name Type Comment
str1 string The first of the strings to be compared.
str2 string The second of the strings to be compared.

Return value

Example

string s1
string s2

set s1 "hello"
set s2 "hi"

echo <zs:strcmp s1 s2>

… the output of which is written to the event log by echo as:

-1

Comments

None.

See also