So this is more than just checking if a user input string in an array because if the string is actually in the array and the bool returns true I want it to write some custom text.
{
static void Main(string[] args)
{
string[] name= {"Bob","Bob2","Bob3","Bob4"};
bool exists = name.Contains(string userName= Console.ReadLine());
if (exists == true)
Console.WriteLine("Hi " + userName);
Console.ReadLine();
}
}
I know I can't run the code like this but I'm looking for a similar way to run it but I'm not sure how to store user input and still have the bool check if the user inuputed string is in the string array.
