How to check if a string contains anything other than specific characters?
Hi, I'm trying to make a function that does this:
-Assigns input to a string
-Warns you if it contains anything that isn't a normal integer
-Assigns the contents to an int variable if the string only contains any conbinations of numbers 1 to 9.
I'm tryin to use the ! operator to check if a string contains anything that isn't a specific symbol but it seems to behave very strangely when used alongside the || operator.
It returns false if I input "12" or "21" but true if I input "1", "2" or any other numbers or letters.
Can anyone help me get this to work?