你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
set_has_element()
确定指定的集中是否包含指定的元素。
语法
set_has_element(
set,
value)
详细了解语法约定。
参数
名称 | 类型 | 必需 | 说明 |
---|---|---|---|
set | dynamic |
✔️ | 要搜索的输入数组。 |
value | ✔️ | 要搜索的值。 此值的类型应为 long 、int 、double 、datetime 、timespan 、decimal 、string 、guid 或 bool 。 |
返回
true
或 false
取决于数组中是否存在该值。
示例
print arr=dynamic(["this", "is", "an", "example"])
| project Result=set_has_element(arr, "example")
输出
结果 |
---|
true |
相关内容
使用 array_index_of(arr, value)
查找数组中该值所在的位置。 这两个函数具有相同的性能。
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈