StringBuilder (@NotNull StringBuilder builder, char symbol) { int index = builder.length() - 1; while (index >= 0 && builder.charAt(index) == symbol) index--; builder.setLength(index + 1); return builder; }