public static function exactLength($value, int $length, string $encoding = 'UTF-8'): bool
    {
        if (!static::isStringCastable($value)) {
            return false;
        }

        $strlen = (int) mb_strlen((string) $value, $encoding);

        return $strlen === $length;
    }
public static function exactLength($value, int $length, string $encoding = 'UTF-8'): bool
    {
        if (!static::isStringCastable($value)) {
            return false;
        }

        $strlen = (int) mb_strlen((string) $value, $encoding);

        return $strlen === $length;
    }
public static function exactLength ( $ value , int $ length , string $ encoding = 'UTF-8' ) : bool { if ( ! static :: isStringCastable ( $ value ) ) { return false ; } $ strlen = ( int ) mb_strlen ( ( string ) $ value , $ encoding ) ; return $ strlen === $ length ; }
Checks if value has an exact string length

@param mixed  $value    The value
@param int    $length   The string length
@param string $encoding The string encoding

@return bool
Checks if value has an exact string length