Java Array Search searchInStringArray(String key, String[] data)

Here you can find the source of searchInStringArray(String key, String[] data)

Description

search In String Array

License

Open Source License

Declaration

public static boolean searchInStringArray(String key, String[] data) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.*;

public class Main {
    public static boolean searchInStringArray(String key, String[] data) {
        Set<String> values = new HashSet<String>(Arrays.asList(data));
        return values.contains(key);
    }//from   w w w .  j  a  v a2  s.c  o m
}

Related

  1. memchr(T[] ptr, T value)
  2. replaceAll(String text, char[] toSearch, char toReplace)
  3. search(double[] input, int[] bounds, double x)
  4. Search(int[] in, int val)
  5. searchFirst(String[] target, String key)