public static function removeSuffix($string, $suffix)
    {
        if (self::endsWith($string, $suffix)) {
            return mb_substr($string, 0, -mb_strlen($suffix));
        }
        return $string;
    }
public static function removeSuffix($string, $suffix)
    {
        if (self::endsWith($string, $suffix)) {
            return mb_substr($string, 0, -mb_strlen($suffix));
        }
        return $string;
    }
public static function removeSuffix ( $ string , $ suffix ) { if ( self :: endsWith ( $ string , $ suffix ) ) { return mb_substr ( $ string , 0 , - mb_strlen ( $ suffix ) ) ; } return $ string ; }
Returns a new string without the given suffix.

Example:
<code>
$string = 'JohnSnow';
$withoutSuffix = Strings::removeSuffix($string, 'Snow');
</code>
Result:
<code>
John
</code>

@param string $string
@param string $suffix
@return string
Returns a new string without the given suffix .