跳转到主内容

//ERDDAP/com.cohort.util/ScriptString2/lineContaining

lineContaining

[JVM]
open fun lineContaining(ar: Array<Any>, s: String): Int

This finds the first element in Object[] where the ar[i].toString value contains the substring s.

Return

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

Parameters

JVM

arthe array of objects
sthe String to be found

[JVM]
open fun lineContaining(ar: Array<Any>, s: String, startAt: Int): Int

This finds the first element in Object[] (starting at element startAt) where the ar[i].toString value contains the substring s.

Return

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

Parameters

JVM

arthe array of objects
sthe String to be found
startAtthe first element of ar to be checked. If startAt <0, this starts with startAt = 0.