CSharp examples for System:Char
Checks for character existence in char array
// Copyright (c) 2014 Morgan Stanley All rights reserved using System.Linq; using System.Diagnostics.CodeAnalysis; public class Main{ /// <summary> /// Checks for character existence /// </summary> /// <param name="value">Source Character</param> /// <param name="chars">Array of characters</param> /// <returns>true if exists, otherwise false</returns> public static bool In(this char value, params char[] chars) {//from w w w.j a v a 2s . co m return chars.Any(c => c == value); } }