How to check if a particular character exists within a character array
.net, arrays, c#
Solution
if (x.Contains(c))
{
//// Do Something
}
Using .NET 3.0/3.5; you will need a `using System.Linq;`
Problem
I am using an array within a C# program as follows: ``` char[] x = {'0','1','2'}; string s = "010120301"; foreach (char c in s) { // check if c can be found within s } ``` How do I check each char c to see if it is found within the character array x?