[#boost-urls-url-remove_fragment]
= xref:boost.adoc[boost]::xref:boost/urls.adoc[urls]::xref:boost/urls/url.adoc[url]::remove&lowbar;fragment
:relfileprefix: ../../../
:mrdocs:


Remove the fragment

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url.hpp#L482[boost&sol;url&sol;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:boost/urls/url.adoc[url]&
remove&lowbar;fragment() noexcept;
----

== Description


This function removes the fragment&period;        An empty fragment is distinct from        having no fragment&period;


=== 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&period;


=== Exception Safety

Throws nothing&period;


=== BNF

[,cpp]
----
fragment    = *( pchar / "/" / "?" )
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.5[3&period;5&period;  Fragment]



== See Also


xref:boost/urls/url_base/remove_fragment.adoc[remove&lowbar;fragment],            xref:boost/urls/url_base/set_encoded_fragment.adoc[set&lowbar;encoded&lowbar;fragment],            xref:boost/urls/url_base/set_fragment.adoc[set&lowbar;fragment]&period;






[.small]#Created with https://www.mrdocs.com[MrDocs]#
