-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,901
  • 21
  • 84
  • 115
  • Please don't use the JavaScript tag when you're really referring to Java. See https://stackoverflow.com/q/245062/6296561 – Zoe May 24 '19 at 15:11

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
  • 90,003
  • 9
  • 87
  • 127