/*@strB: StringBuilder 对象
@str: 原字符串变量
@deleteStr: 要删除的子字符串
*/
public static void deleteStr(StringBuilder strB,String str,String deleteStr){
str = strB.delete(strB.indexOf(deleteStr), strB.indexOf(deleteStr)+4).toString();
if(str.contains(deleteStr)){
deleteStr(new StringBuilder(str),str,deleteStr);
}else{
System.out.println("没有 "+deleteStr+" 子字符串了");
System.out.println(str);
return;
}
}
|
|