library/Haste/Util/StringUtil.php
public static function slimText($strText, $intLength = null, $allowedTags = '<p><br><br/>')
    {
        $strText = strip_tags($strText, $allowedTags);

        if ($intLength !== null) {
            $strText = static::truncateHtml($strText, $intLength);
        }

        $strText = str_replace(['[-]', '&shy;', '[nbsp]', '&nbsp;'], ['', '', ' ', ' '], $strText);

        return $strText;
    }
public static function slimText($strText, $intLength = null, $allowedTags = '<p><br><br/>')
    {
        $strText = strip_tags($strText, $allowedTags);

        if ($intLength !== null) {
            $strText = static::truncateHtml($strText, $intLength);
        }

        $strText = str_replace(['[-]', '&shy;', '[nbsp]', '&nbsp;'], ['', '', ' ', ' '], $strText);

        return $strText;
    }
public static function slimText ( $ strText , $ intLength = null , $ allowedTags = '<p><br><br/>' ) { $ strText = strip_tags ( $ strText , $ allowedTags ) ; if ( $ intLength !== null ) { $ strText = static :: truncateHtml ( $ strText , $ intLength ) ; } $ strText = str_replace ( [ '[-]' , '&shy;' , '[nbsp]' , '&nbsp;' ] , [ '' , '' , ' ' , ' ' ] , $ strText ) ; return $ strText ; }
Strip tags from text and truncate if needed

@param        $strText     The text
@param null $intLength Truncate length or null if not needed
@param string $allowedTags Allowed tags for strip_tags

@return string The slim text
Strip tags from text and truncate if needed