Berserk Docs
Scalar FunctionsString Functions

has_any_index

Returns the index of the first matching value in the source string.

Syntax

has_any_index(source, lookups)

Parameters

Prop

Type

Returns: long

Examples

Example 1 — Returns 1 (index of "Lindisfarne" in the lookup list)

print has_any_index(
  "The longship Naglfar sailed to Lindisfarne",
  "Kattegat",
  "Lindisfarne",
  "York"
)
print_0 (long)
31

Example 2 — Returns -1 when no lookup value matches

print has_any_index("The longship Naglfar sailed to Lindisfarne", "Paris", "York", "Dublin")
print_0 (long)
-1

On this page