Hello here is the question.
Check whether s1 has the prefix AAA and assign the result to a boolean variable b
Check whether s1 has the prefix AAA and assign the result to a boolean variable b
This is what I have so far
/**
*
* @author samue_000
*/
public class N95e {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
String s1 = "Welcome";
String s2 = "welcome";
boolean b = true;
s1.lastIndexOf("AAA");
if (s1.lastIndexOf("AAA") == true) {
}
System.out.println(s1.lastIndexOf("AAA"));
}
}
Really stuck on this and mind has gone blank. So help would be appreciated