I have bunch of usernames in this arraylist and I want to check whether username exists in the arraylist or not but the method always returns false.
public bool check_username(ArrayList userList, string username)
{
for (int i = 0; i < userList.Count; i++)
{
if (userList[i].ToString() == username)
{
return true;
}
}
return false;
}