public static function truncate($str, $length, $trailing='...') {
		$length -= mb_strlen($trailing);

		if (mb_strlen($str) > $length)
			return mb_substr($str,0,$length).$trailing;
		return $str;
	}
public static function truncate($str, $length, $trailing='...') {
		$length -= mb_strlen($trailing);

		if (mb_strlen($str) > $length)
			return mb_substr($str,0,$length).$trailing;
		return $str;
	}
public static function truncate ( $ str , $ length , $ trailing = '...' ) { $ length -= mb_strlen ( $ trailing ) ; if ( mb_strlen ( $ str ) > $ length ) return mb_substr ( $ str , 0 , $ length ) . $ trailing ; return $ str ; }
Truncate a string.
@param  string  $str
@param  integer $length
@param  string  $trailing
@return string
@api
Truncate a string .