protected static String trimEnd ( final String value , final char trimChar ) { int stopDex = value . length ( ) - 1 ; while ( stopDex > 0 && value . charAt ( stopDex ) == trimChar ) { stopDex -- ; } return stopDex == value . length ( ) - 1 ? value : value . substring ( stopDex ) ; }
Trims the specified character from the end of a string .