Check out example codes for "how to know if an element is in an array c#". It will help you in understanding the concepts better.

Code Example 1

string[] names = "John", "Susan", "Sophie";
if (names.Contains("John") //Using Contains you can know if a specific value is on an array
    {
    Console.WriteLine("John is a name");
    }

Learn ReactJs, React Native from akashmittal.com