public float trimLastSpace ( ) { BaseFont ft = font . getFont ( ) ; if ( ft . getFontType ( ) == BaseFont . FONT_TYPE_CJK && ft . getUnicodeEquivalent ( ' ' ) != ' ' ) { if ( value . length ( ) > 1 && value . endsWith ( "\u0001" ) ) { value = value . substring ( 0 , value . length ( ) - 1 ) ; return font . width ( ' ' ) ; } } else { if ( value . length ( ) > 1 && value . endsWith ( " " ) ) { value = value . substring ( 0 , value . length ( ) - 1 ) ; return font . width ( ' ' ) ; } } return 0 ; }
Trims the last space .