public String encodedFragment() {
        if (fragment == null) return null;
        int fragmentStart = url.indexOf('#') + 1;
        return url.substring(fragmentStart);
    }
public String encodedFragment ( ) { if ( fragment == null ) return null ; int fragmentStart = url . indexOf ( '#' ) + 1 ; return url . substring ( fragmentStart ) ; }
Returns this URL's encoded fragment, like {@code "abc"} for {@code http://host/#abc}. This
returns null if the URL has no fragment.

<p><table summary="">
<tr><th>URL</th><th>{@code encodedFragment()}</th></tr>
<tr><td>{@code http://host/}</td><td>null</td></tr>
<tr><td>{@code http://host/#}</td><td>{@code ""}</td></tr>
<tr><td>{@code http://host/#abc}</td><td>{@code "abc"}</td></tr>
<tr><td>{@code http://host/#abc|def}</td><td>{@code "abc|def"}</td></tr>
</table>