L3DT users' wiki
Large 3D terrain generator

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

  • 0 if the strings are identical,
  • <0 if str1 is lexicographically less than str2, or;
  • >0 if str1 is lexicographically greater than str2.

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

 
plugins/general/zeoscript/reference/functions/strcmp.txt · Last modified: 2017/08/31 05:28 (external edit)
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki