Hey there, I am, trying to use a String Array to use as a filter system for character names so you cannot use fowl language as a character name.
This is what I have it set up as:
namespace TextAdventure
{
class Program
{
static void Main(string[] args)
{
bool curses = false;
bool propername = false;
string name;
string[] names = new string[20]
names[0] = "Damn";
names[1] = "Leeroy Jenkins";
do
{
name = Console.ReadLine();
if(name == names[0])
{
curses = true;
Console.WriteLine("The value entered is not permitted.");
}
else
{
propername = true;
}
}
while(!propername);
}
}
}
I want to be able to check if the entered name is any value inside of the Array instead of just one at a time as that would mean I needed 20 if Statements and that is obviously not practical and just plain silly.
Any ideas?