Java Char Array Contain charArrayContains(final char e, final char[] f)

Here you can find the source of charArrayContains(final char e, final char[] f)

Description

Returns true if the char[], f, contains the input char, e.

License

Open Source License

Parameter

Parameter Description
e a parameter
f a parameter

Declaration

private static boolean charArrayContains(final char e, final char[] f) 

Method Source Code

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

public class Main {
    /**//  www .j  a  v a2  s.  co m
     * Returns true if the char[], <code>f</code>, contains the input char,
     * <code>e</code>.
     *
     * @param e
     * @param f
     * @return
     */
    private static boolean charArrayContains(final char e, final char[] f) {
        for (final char z : f) {
            if (e == z) {
                return true;
            }
        }
        return false;
    }
}