Is Array Contains a char value - CSharp System

CSharp examples for System:Array Search

Description

Is Array Contains a char value

Demo Code


using System.Text;
using System.Collections.Generic;
using System;/*from w w w.  j  a va2  s  .  c om*/

public class Main{
        public static bool IsArrayContains(char[] chars, char target)
        {
            for (int i = 0; i < chars.Length; i++)
                if (chars[i] == target)
                    return true;
            return false;
        }
}

Related Tutorials