public static function cleanExtension(?string $string): ?string
    {
        // no extension in string is founded
        if (!self::contains('.', $string)) {
            return $string;
        }

        $splited = explode('.', $string);
        array_pop($splited);
        return implode('.', $splited);
    }
public static function cleanExtension(?string $string): ?string
    {
        // no extension in string is founded
        if (!self::contains('.', $string)) {
            return $string;
        }

        $splited = explode('.', $string);
        array_pop($splited);
        return implode('.', $splited);
    }
public static function cleanExtension ( ? string $ string ) : ? string { // no extension in string is founded if ( ! self :: contains ( '.' , $ string ) ) { return $ string ; } $ splited = explode ( '.' , $ string ) ; array_pop ( $ splited ) ; return implode ( '.' , $ splited ) ; }
Remove extension from string
@param string $string
@return string|null
Remove extension from string