public static String abbreviate ( String _str , int _length ) { if ( _str == null ) { return null ; } if ( _str . length ( ) <= _length ) { return _str ; } String abbr = _str . substring ( 0 , _length - 3 ) + "..." ; return abbr ; }
Abbreviates a String using ellipses .