package October;
public class Common {
public static void main(String[] args) {
String s1="abcdef";
String s2="bcde";
int head=s1.indexOf(s2);
int bottom=head+s2.length()-1;
System.out.println(reverse(s1,head,bottom));
}
public static String reverse(String s1,int start,int end) {
char temp;
char[] c=s1.toCharArray();
//首元素和尾元素依次交换
for (int i = start,j=end; i <j; i++,j--) {
temp=c[i];
c[i]=c[j];
c[j]=temp;
}
//将交换后C数组重新创建一个string
return new String(c);
}
}