:relfileprefix: ../../../
[#boost-urls-static_url-remove_fragment]

= xref:boost.adoc[pass:[boost]]::xref:boost/urls.adoc[pass:[urls]]::xref:boost/urls/static_url.adoc[pass:[static_url]]::remove_fragment


Remove the fragment


== Synopsis

Declared in header `<https://www.github.com/boostorg/url/blob/develop/include/boost/url/static_url.hpp#L413[boost/url/static_url.hpp,window=blank_]>`

[source,cpp,subs="verbatim,macros,-callouts"]
----
xref:boost/urls/static_url.adoc[static_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]
.



