In my very basic program I am asking user to input a string (ingredient)
Scanner scnr = new Scanner(System.in);
System.out.println("Please enter the name of the ingredient: ");
nameOfIngredient = scnr.next();
How do I make sure that the user is not inputting something silly like 123456.
I just cannot figure out how to filter the users input with WORDS. I know the string will accept 123456 but I want to be able to have my simple program be like "Hey you did not enter in a name of ingredient" if they enter in numbers.
Hope that makes sense lol.
Ty to anyone who reads this silly post, I'm so confused tho!
This post was edited by GoldRaker1337 on Feb 6 2022 08:47am