[#boost-urls-url-remove_fragment] = xref:boost/urls/url/remove_fragment.adoc[boost::urls::url::remove_fragment] :relfileprefix: ../../../ :mrdocs: Remove the fragment == Synopsis Declared in `<https://www.github.com/boostorg/url/blob/develop/include/boost/url/url.hpp#L485[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 * https://datatracker.ietf.org/doc/html/rfc3986#section-3.5[] == Return Value `*this` == See Also xref:boost/urls/url/remove_fragment.adoc[`remove_fragment`], xref:boost/urls/url/set_encoded_fragment.adoc[`set_encoded_fragment`], xref:boost/urls/url/set_fragment.adoc[`set_fragment`]. [.small]#Created with https://www.mrdocs.com[MrDocs]#