What can I do to get a string as an "action word"? Let me explain it. I want give the User a decision "You want to go or wait?" Now the User should type "Go" or "wait" and the code continues with an if statement. Is it possible to do that and is it possible set more words to one action e.g. "Go", "go", "go for it" (that every word is activating the same if statement)
Sure, strings can be, just like other data types, compared by the == and != operator. If multiple words are supposed to trigger one action, you can chain them inside the if-condition using the OR operator (||).
Usually you use a loop that asks the user to choose an option until the input matches one of the options you provided.
An important operation that is especially useful here is transforming the string to lowercase, so you need to perform less comparisons (example in the code).
Here is an example for such a menu, let me know if you have any questions on it:
Indeed, Muaz Ahmad, because you can convert a character to a numerical value, to be more precise, to its ASCII value. Therefore, as you pointed out, we can use characters in switch statements, but not strings, because those can not be converted to a fixed identical numerical value.
And since the question was regarding strings, a switch statement would not work for this particular problem.