你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

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")

输出

结果
true

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