startsWith / endsWith
str1="ABCDEFG"; str2="AB"; str3="EFG"; boolean a=str1.startsWith(str2); boolean b=str1.endsWith(str2); System.out.println(a); System.out.println(b); 결과 true true
str1="ABCDEFG"; str2="AB"; str3="EFG";
boolean a=str1.startsWith(str2); boolean b=str1.endsWith(str2);
System.out.println(a); System.out.println(b);
결과
true true