I have to check the return value of the method, if it equals the value of a string which is either "Yes" or "No" or should I use a regex which matches with the pattern of the string i.e Yes or No.
So essentialy, I am trying to write in this way if ((ru.getTest()).equals(("Yes") || (“No”))) {......
Is it the way , I should proceed or am wrong?
Adding to it.
I would like to post a detailed explanation of my question.
if(ru.getTest().equals("yes/oui") || ru.getTest().equals("no/non")),
It is not just Yes but along with the French literal added to it. So, if (the above condition is met), it should trim the French literal portion and keep only the 'yes' or 'no'..
I tried with this:
if ((ru.getTest()).equals("Yes/Oui") || (ru.getTest()).equals(“No/Non”)) {
Test = ru.getTest().substring(0, Test.indexOf ('/'));
Please correct me If I am wrong.