I want to detele the last word of string in StringBuilder here is it my code:
builder.append(" where");
if(type.equals(EnumTypePrestation.OPTIQUE)){
builder.append(" d.idDossier=p.id and d.statut=4 and ");
}
builder.substring(0,builder.lastIndexOf(" ")-1);
the builder contains : WHERE d.idDossier = p.id AND d.statut = 4 AND
I want to remove the last word "AND" can anyone help me to do that!