public static function removeEnd($str, $remove)
    {
        if ((true === self::isEmpty($str))
            || (true === self::isEmpty($remove))
        ) {
            return $str;
        }

        if (true === self::endsWith($str, $remove)) {
            return self::substring(
                $str,
                0,
                self::length($str) - self::length($remove)
            );
        }

        return $str;
    }