private function removeLastSlash($string)
    {
        if ('/' === substr($string, strlen($string) - 1)) {
            $string = substr($string, 0, strlen($string) - 1);
        }
        
        return $string;
    }
private function removeLastSlash($string)
    {
        if ('/' === substr($string, strlen($string) - 1)) {
            $string = substr($string, 0, strlen($string) - 1);
        }
        
        return $string;
    }
private function removeLastSlash ( $ string ) { if ( '/' === substr ( $ string , strlen ( $ string ) - 1 ) ) { $ string = substr ( $ string , 0 , strlen ( $ string ) - 1 ) ; } return $ string ; }
Remove the last slash of the string.

@param string $string

@return string
Remove the last slash of the string .