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);
    }