replacing last char of string logics
hi all,
i need to replace the last char of string by a ")"
i did this..
Code:
query = query.substring(0,query.length()-1)+")";
and my manager wants something else other than (query.length -1)!!
what cud be the other way around which is better than this.
this is the complete code list:
Code:
query+="SELECT EXTID , REPLACE(ICI_ID, ' ', '') ICI_ID, CPY_SID, LINE_NUMBER";
query+=" FROM TEMP_OTC_CSA_ID, COUNTERPARTY";
query+=" WHERE REPLACE(ICI_ID, ' ', '') IN (EXTERNAL_ID,BIC_CODE)";
query+=" AND SOURCE_ID IN (";
String cpySrc[] = cpySource.split("\\,");
for(int i=0; i<cpySrc.length; i++){
query+= "'"+cpySrc[i]+"',";
}
query = query.substring(0,query.length()-1)+")";
query+=" ORDER BY LINE_NUMBER, EXTID";