Loading

INDEXOF

lists maps strings gts
  This function allows you to find: 
  • the indexes of an item in a list
  • the indexes of an item in a byte array
  • the indexes of a substring in a string
  • the keys of an item in a map
  • the timestamps of a value in a GTS
INDEXOF is available since version 2.10.1.

Signatures

Examples

[ 'a' 'b' 'c' 'd' ] 'b' 0 INDEXOF // should return [1] { 'a' 42 'b' 54 'c' 75 'd' 54 } 54 0 INDEXOF // should return ["b","d"] 'abcdefg' 'cd' 0 INDEXOF // should return [2] NEWGTS 'g' STORE 0 100 <% 'ts' STORE $g [ $ts $ts 10 * ] ADDVALUE DROP %> FOR $g 180 0 INDEXOF // should return [18]