BOF 3—1 字符串循环移位包含问题

public class Contains {


public static void main(String[] args) {
String strA = "adasdfd";
String strB = "dadsfda";

System.out.println(new Contains().contain(strA, strB));
}


public boolean contain(String strA, String strB) {
String strC = strA.concat(strA);
boolean isContain;
int index = strB.indexOf(strA);

if(index >= 0) {
isContain = true;
}else {
isContain = false;
}

return isContain;
}

你可能感兴趣的:(字符串)