Please do excuse my lack of experience, but I have a (simple?) question that I cannot seem to find laying around.
- Having issues combining conditions to test for if()
- I wish to test multiple strings in one if statement, WITHOUT adding each particular thing to test for in its own parenthesis as done in the first example.
Alternatives attempted:Code:if ((answ == "yes") || (answ == "Yes") || (answ == "YES"))
I'm sure it's something rather simplistic that I'm just missing out on, but no tutorials I've seen explain the process of testing multiple string conditions in an if statement.Code:if (answ == "yes" || "Yes" || "YES") if (answ == "yes, "Yes", "YES")
The first code I've included does work, but I presumed there was a better, more ethical way to approach my problem. Thanks in advance.