private StringBuilder removeLastComma(StringBuilder strBuff) {
StringBuilder stringBuff = new StringBuilder(strBuff.toString().trim());
stringBuff.trimToSize();
int lastColPos = stringBuff.lastIndexOf(",");
if (lastColPos > -1 && lastColPos == stringBuff.length() - 1) {
stringBuff.deleteCharAt(lastColPos);
}
return stringBuff;
}
StringBuilder stringBuff = new StringBuilder(strBuff.toString().trim());
stringBuff.trimToSize();
int lastColPos = stringBuff.lastIndexOf(",");
if (lastColPos > -1 && lastColPos == stringBuff.length() - 1) {
stringBuff.deleteCharAt(lastColPos);
}
return stringBuff;
}
No comments:
Post a Comment