strcmp
比较字符串
Syntax
Description
Examples
Input Arguments
Output Arguments
提示
The
strcmp
function is intended for comparison of text. If used on unsupported data types,strcmp
总是返回0
。For case-insensitive text comparison, use
strcmpi
instead ofstrcmp
。Although
strcmp
shares a name with a C function, it does not follow the C language convention of returning0
when the text inputs match.With string arrays, you can use relational operators (
==
,〜=
,<
,>
,<=
,> =
) instead ofstrcmp
。您可以像数字阵列一样比较和对字符串数组进行比较。