Why am I getting a wrong output in a console in C#?
Solution 1:
IndexOf
returns -1
when the string passed is not a substring.
Convert.ToBoolean
is true when the passed int is not 0.
You can do userInput1 != -1
but String.Contains
is what you want.