Skip to contents

Equivalent of .IndexOf() in Insight Maker

Usage

indexof(haystack, needle)

Arguments

haystack

Vector or string to search through

needle

Value to search for

Value

Index

Examples

indexof(c("a", "b", "c"), "b") # 2
#> [1] 2
indexof("haystack", "hay") # 1
#> [1] 1