String strl = "12ssweeks324failed";
int endindex1 = strl.indexOf("weeks");
System.out.println(strl.substring(0, endindex1));
if (endindex1 != -1) {
System.out.println("==1");
} else {
System.out.println("==2");
}
int startindex = endindex1 + 5;
endindex1 = strl.indexOf("failed");
System.out.println(strl.substring(startindex, endindex1));
java基础
最新推荐文章于 2022-11-04 11:25:00 发布