public function crop($string, $maximumCharacters, $suffix = '')
    {
        $string = (string)$string;

        if (UnicodeFunctions::strlen($string) > $maximumCharacters) {
            $string = UnicodeFunctions::substr($string, 0, $maximumCharacters);
            $string .= $suffix;
        }

        return $string;
    }
public function crop($string, $maximumCharacters, $suffix = '')
    {
        $string = (string)$string;

        if (UnicodeFunctions::strlen($string) > $maximumCharacters) {
            $string = UnicodeFunctions::substr($string, 0, $maximumCharacters);
            $string .= $suffix;
        }

        return $string;
    }
public function crop ( $ string , $ maximumCharacters , $ suffix = '' ) { $ string = ( string ) $ string ; if ( UnicodeFunctions :: strlen ( $ string ) > $ maximumCharacters ) { $ string = UnicodeFunctions :: substr ( $ string , 0 , $ maximumCharacters ) ; $ string .= $ suffix ; } return $ string ; }
Crop a string to ``maximumCharacters`` length, optionally appending ``suffix`` if cropping was necessary.

@param string $string The input string
@param integer $maximumCharacters Number of characters where cropping should happen
@param string $suffix Suffix to be appended if cropping was necessary
@return string The cropped string
Crop a string to maximumCharacters length optionally appending suffix if cropping was necessary .