$string = sprintf( "%.20s..", $string ) if length($string) > 22; [download]
In reply to Re: Or there's also . . . by jmcnamara in thread Cutting down a string by Anonymous Monk