set_has_element()

确定指定的集中是否包含指定的元素。

语法

set_has_element(set,value)

详细了解语法约定

参数

客户 类型​​ 必需 说明
set dynamic 要搜索的输入数组。
value 要搜索的值。 此值的类型应为 longintdoubledatetimetimespandecimalstringguidbool

返回

truefalse 取决于数组中是否存在该值。

示例

print arr=dynamic(["this", "is", "an", "example"]) 
| project Result=set_has_element(arr, "example")

输出

结果

使用 array_index_of(arr, value) 查找数组中该值所在的位置。 这两个函数具有相同的性能。