:relfileprefix: ../../../ [#boost-urls-url-remove_fragment] = xref:boost.adoc[pass:[boost]]::xref:boost/urls.adoc[pass:[urls]]::xref:boost/urls/url.adoc[pass:[url]]::remove_fragment Remove the fragment == Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost/urls/url.adoc[url]& remove_fragment() noexcept; ---- == Description This function removes the fragment. An empty fragment is distinct from having no fragment. === Example [,cpp] ---- assert( url( "?first=john&last=doe#anchor" ).remove_fragment().buffer() == "?first=john&last=doe" ); ---- === Postconditions [,cpp] ---- this->has_fragment() == false && this->encoded_fragment() == "" ---- === Complexity Constant. === Exception Safety Throws nothing. === BNF [,cpp] ---- fragment = *( pchar / "/" / "?" ) ---- === Specification * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.5[3.5. Fragment] == See Also xref:boost/urls/url_base/remove_fragment.adoc[remove_fragment] , xref:boost/urls/url_base/set_encoded_fragment.adoc[set_encoded_fragment] , xref:boost/urls/url_base/set_fragment.adoc[set_fragment] .