On this page本页内容
$strcasecmp
¶Performs case-insensitive comparison of two strings. Returns
$strcasecmp
has the following syntax:语法如下所示:
The arguments can be any valid expression as long as they resolve to strings. For more information on expressions, see Expressions.有关表达式的详细信息,请参阅表达式。
$strcasecmp
only has a well-defined behavior for strings of ASCII characters.
For a case sensitive comparison, see $cmp
.
Consider a 考虑一个inventory
collection with the following documents:inventory
集合带有以下文档:
The following operation uses the $strcasecmp
operator to perform case-insensitive comparison of the quarter
field value to the string "13q4"
:
The operation returns the following results:操作返回以下结果: