This is my first time posting here, so please tell me if I need to correct anything in this post. I\'d like to ask for help with something that\'s been giving me some trouble.
It is returning true because your testing one char of randomString
public static boolean Checkword( String pattern, String randomString ){
return ( randomString .contains( pattern ) ) ? true : false;
}
String pattern = "LABEL";
String randomString = "BFEABLDEG";
Checkword( pattern, randomString );
//return false
randomString = "AZDAZLABELIIDZA";
Checkword( pattern, randomString );
//return true