I want to check whether a a person has entered "y" or "Y" on a console screen.
I'm trying to use:
string answer;
do
{
Console.WriteLine("Please enter the actors name");
tempActorList.Add(Console.ReadLine());
Console.WriteLine("Do you want to add another actor?");
answer = Console.ReadLine();
}
while ((answer = "Y" || "y"));
but apparently the || cannot be used on strings.
Can anyone suggest something that might work instead? Hopefully something that won't over inflate my code.

1 answers
When comparing variables in C#, you need to use the compare operator '==' rather than '='
Also, I would suggest reforming your code as below:
answered one year ago by:
2499
17279
Although foamy's solution is best, I'd just add that your original approach would have worked if you'd changed it to: while(answer == "Y" || answer == "y") as you'd then be OR'ing two boolean expressions.