移動先: 概要 戻り値 関連項目 MEL の例

概要

strcmp string string

strcmp は「元に戻す」が不可能「照会」が不可能「編集」が不可能です。

string 型の引数 2 つを辞書的に比較します。第 1 の引数が第 2 の引数に比べて小さいか、同じか、大きいかによって、0 より小さい整数、0、0 より大きい整数のどれかを返します。

戻り値

int比較値

関連項目

gmatch, match

MEL の例

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 //