Hey guys I'm in the middle of a java assigment and I'm in a bit of a dialema...
Does anyone know how to get java to check if a string contains a combination of 2 other strings?
So far I have
boolean notTrue = false;
if ((!notTrue)&&((logins).contains(emailadd + ", " + password))) {
MainCourse loggedIn = new MainCourse();
loggedIn.setVisible(true);
}
But the above isn't working for some reason. Logins is a text file which is being read / streamed in as a string... that part works fine. The text file stores the email address and password as plain text as emailadd, password and I've copied and pasted the code exactly from the registration class. It still isnt working for some reason and I cant see why... It's likely something simple but I simply cannot see what.
Does anyone know how to get java to check if a string contains a combination of 2 other strings?
So far I have
boolean notTrue = false;
if ((!notTrue)&&((logins).contains(emailadd + ", " + password))) {
MainCourse loggedIn = new MainCourse();
loggedIn.setVisible(true);
}
But the above isn't working for some reason. Logins is a text file which is being read / streamed in as a string... that part works fine. The text file stores the email address and password as plain text as emailadd, password and I've copied and pasted the code exactly from the registration class. It still isnt working for some reason and I cant see why... It's likely something simple but I simply cannot see what.
Last edited: