public static String stripEndingSlash(String string) {
        if (string == null) {
            return null;
        }
        if (string.endsWith("/")) {
            string = string.substring(0, string.length() - 1);
        }
        return string;
    }
public static String stripEndingSlash(String string) {
        if (string == null) {
            return null;
        }
        if (string.endsWith("/")) {
            string = string.substring(0, string.length() - 1);
        }
        return string;
    }
public static String stripEndingSlash ( String string ) { if ( string == null ) { return null ; } if ( string . endsWith ( "/" ) ) { string = string . substring ( 0 , string . length ( ) - 1 ) ; } return string ; }
Remove ending slash if present and return the string without ending slash

@param string
@return
Remove ending slash if present and return the string without ending slash