The Sample Code which needs a solution?
public class TestJJava {
public static void main(String[] args) {
// TODO Auto-generated method stub
This is what you are supposed to do.
String first3 = abc.substring(0,3);
boolean found = false;
for (String s : lstValues) {
if (s.startsWith(first3)) {
found = true;
break;
}
}
if (found) {
System.out.println("**** Match Found ***");
} else {
System.out.println("**** No Match Found ****");
}
Go through the list checking each entry until you find a match.