GitHubContribute in GitHub: Edit online

set_has_element()

Determines whether the specified set contains the specified element.

Syntax

set_has_element(array,value)

Arguments

  • array: Input array to search.
  • value: Value to search for. The value should be of type long, integer, double, datetime, timespan, decimal, string, or guid.

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

Results

Result
1

See also

Use array_index_of(arr, value) to find the position at which the value exists in the array. Both functions are equally performant.