set_has_element()set_has_element()

确定指定的集中是否包含指定的元素。Determines whether the specified set contains the specified element.

语法Syntax

set_has_element(array , value)set_has_element(array , value)

参数Arguments

  • array :输入要搜索的数组。array : Input array to search.
  • value :要搜索的值。value : Value to search for. 此值的类型应为 longintegerdoubledatetimetimespandecimalstringguidThe value should be of type long, integer, double, datetime, timespan, decimal, string, or guid.

返回Returns

True 或 false 取决于数组中是否存在该值。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")
结果Result
11

请参阅See also

使用 array_index_of(arr, value) 查找数组中该值所在的位置。Use array_index_of(arr, value) to find the position at which the value exists in the array. 这两个函数具有相同的性能。Both functions are equally performant.