When you have to loop through a collection and make a string of each data separated by a delimiter, you always end up with an extra delimiter at the end, e.g.
for(String serverId : serverIds) {
sb.append(serverId);
sb.append(",");
}
Gives something like : serverId_1, serverId_2, serverId_3,
I would like to delete the last character in the StringBuilder (without converting it because I still need it after this loop).