public static String chomp ( String s ) { if ( s . length ( ) == 0 ) return s ; int l_1 = s . length ( ) - 1 ; if ( s . charAt ( l_1 ) == ' ' ) { return s . substring ( 0 , l_1 ) ; } return s ; }
Returns the supplied string with any trailing \ n removed .