-1

I am trying to make a condition which, if gettingupspeech matches either one of the strings, the if function will set resultText to "Correct! Press Next to move on."

if(gettingupspeech.equals("5 more minutes Mum""five more minutes Mum")){
      resultText.setText("Correct! Press Next to move on.");
 }else{
      resultText.setText("That sounded off, please try again.");
 }
Phantômaxx
  • 37,352
  • 21
  • 80
  • 110

1 Answers1

0

That's just a normal or. So

if(gettingupspeech.equals("5 more minutes Mum") || gettingupspeech.equals("five more minutes Mum"))

If you have a bunch, you can put all the valid answers in a set and do

if(answersSet.contains(gettingupspeech))
Gabe Sechan
  • 84,451
  • 9
  • 82
  • 121