[#boost-urls-url-remove_fragment] = xref:boost.adoc[boost]::xref:boost/urls.adoc[urls]::xref:boost/urls/url.adoc[url]::remove_fragment :relfileprefix: ../../../ :mrdocs: Remove the fragment == Synopsis Declared in `<https://www.github.com/boostorg/url/blob/develop/include/boost/url/url.hpp#L482[boost/url/url.hpp]>` [source,cpp,subs="verbatim,replacements,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]. [.small]#Created with https://www.mrdocs.com[MrDocs]#