src/Lib/StringTool.php
public static function remove_trailing($string, $trailing_string)
    {
        if (StringTool :: end_with($string, $trailing_string))
        {
            return substr($string, 0, strlen($string) - strlen($trailing_string));
        }
        else
        {
            return $string;
        }
    }
public static function remove_trailing($string, $trailing_string)
    {
        if (StringTool :: end_with($string, $trailing_string))
        {
            return substr($string, 0, strlen($string) - strlen($trailing_string));
        }
        else
        {
            return $string;
        }
    }
public static function remove_trailing ( $ string , $ trailing_string ) { if ( StringTool :: end_with ( $ string , $ trailing_string ) ) { return substr ( $ string , 0 , strlen ( $ string ) - strlen ( $ trailing_string ) ) ; } else { return $ string ; } }
Remove a trailing string from a string if it exists
@param $string The string that must be shortened if it ends with a trailing string
@param $trailing_string The trailing string
@return string
Remove a trailing string from a string if it exists