I know how to make a Java Scanner not care about the uppercase or lowercasing, but how do I make it so that it doesn't care about puncuation? I want to do this so that I don't have to type all of this:
if(mirioutput.equalsIgnoreCase("You're an idiot.") ||
mirioutput.equalsIgnoreCase("Your an idiot.") ||
mirioutput.equalsIgnoreCase("You're an idiot") ||
mirioutput.equalsIgnoreCase("Youre an idiot") ||)
{
//code goes here
}
By the way, I'm trying to make a Siri-like program that will respond to what you type, if you're wondering why the text says "You're an idiot."
Thanks to anyone who may be able to help.
Aucun commentaire:
Enregistrer un commentaire