Java Array arrayMember(String[] array, String member)

Here you can find the source of arrayMember(String[] array, String member)

Description

array Member

License

Apache License

Declaration

public static boolean arrayMember(String[] array, String member) 

Method Source Code

//package com.java2s;
/*/*from w w w.  j  ava  2s .  c om*/
   Copyright 2010 Computer and Automation Research Institute, Hungarian Academy of Sciences (SZTAKI)
    
   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at
    
   http://www.apache.org/licenses/LICENSE-2.0
    
   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
*/

public class Main {
    public static boolean arrayMember(String[] array, String member) {
        for (int i = 0; i < array.length; i++) {
            if (array[i] != null && array[i].equals(member)) {
                return true;
            }
        }
        return false;
    }
}

Related

  1. arrayFirstIndexOf(final T[] array, final T value)
  2. arrayFlatten(final int[][] arr)
  3. arrayGetCenter(byte[] array, int location, int length)
  4. arrayIsHave(String[] strs, String str)
  5. arrayLookup(int[] ar, int keystart, int keyend, int forbidden)
  6. arrayMinus(double[] w, double[] v)
  7. arrayNotEmpty(T[] objects, String message)
  8. arrayOfClassType(T... array)
  9. arrayOffloatAsCSStrings(float[] ar)