Here you can find the source of chopIfMatch(StringBuilder sb, char ch)
private static void chopIfMatch(StringBuilder sb, char ch)
//package com.java2s; /*//from w ww .jav a 2 s .co m * JBoss, the OpenSource J2EE webOS * * Distributable under LGPL license. * See terms of license at gnu.org. * * Portions of this file Copyright (C) 2013 Jeremy D Monin <jeremy@nand.net> */ public class Main { private static void chopIfMatch(StringBuilder sb, char ch) { if (sb.length() != 0 && sb.charAt(sb.length() - 1) == ch) sb.setLength(sb.length() - 1); } }