How to check that an array contains a particular value in Scala 2.8? -
i've got array of d unique (int, int) tuples.
i need know if array contains (x, y) value.
am implement search algorithm myself or there standard function in scala 2.8? i've looked @ documentation couldn't find of such there.
that seems easy (unless i'm missing something):
scala> val = array((1,2),(3,4)) a: array[(int, int)] = array((1,2), (3,4)) scala> contains (1,2) res0: boolean = true scala> contains (5,6) res1: boolean = false
i think api calls you're looking in arraylike.
Comments
Post a Comment