Hopp til hovedinnhold

//ERDDAP/com.cohort.util/ScriptString2/indexOfObject

indexOfObject

[JVM]
open fun indexOfObject(ar: Array<Any>, o: Any, startAt: Int): Int

This finds the first element in Object[] (starting at element startAt) where ar[i]==o.

Return

the element number of ar which is equal to s (or -1 if ar is null, or s is null or not found)

Parameters

JVM

arthe array of Objects
othe String to be found
startAtthe first element of ar to be checked. If startAt <0, this starts with startAt = 0. If startAt >= ar.length, this returns -1.

[JVM]
open fun indexOfObject(ar: Array<Any>, o: Any): Int

A variant of indexOfObject() that uses startAt=0.