Android String Array Search indexOf(String[] datas, String val)

Here you can find the source of indexOf(String[] datas, String val)

Description

index Of

Declaration

public static int indexOf(String[] datas, String val) 

Method Source Code

//package com.java2s;

public class Main {
    public static int indexOf(String[] datas, String val) {
        if (val != null && datas != null) {
            for (int i = 0; i < datas.length; i++) {
                if (datas[i] != null && datas[i].equals(val)) {
                    return i;
                }/*w w  w . ja  va  2s  .  co  m*/
            }
        }
        return -1;
    }
}

Related

  1. indexOf(String[] datas, String val)
  2. in(String needle, String... haystack)
  3. containsOnlyAlphaDigitHyphen( final Collection values)
  4. containsOnlyWhiteSpaces( final Collection values)