你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
set_has_element()
Applies to: ✅ Microsoft Fabric ✅ Azure Data Explorer ✅ Azure Monitor ✅ Microsoft Sentinel
Determines whether the specified set contains the specified element.
Syntax
set_has_element(
set,
value)
Learn more about syntax conventions.
Parameters
Name | Type | Required | Description |
---|---|---|---|
set | dynamic |
✔️ | The input array to search. |
value | ✔️ | The value for which to search. The value should be of type long , int , double , datetime , timespan , decimal , string , guid , or bool . |
Returns
true
or false
depending on if the value exists in the array.
Example
print arr=dynamic(["this", "is", "an", "example"])
| project Result=set_has_element(arr, "example")
Output
Result |
---|
true |
Related content
Use array_index_of(arr, value)
to find the position at which the value exists in the array. Both functions are equally performant.