:relfileprefix: ../../../
[#boost-urls-url-remove_userinfo]

= xref:boost.adoc[pass:[boost]]::xref:boost/urls.adoc[pass:[urls]]::xref:boost/urls/url.adoc[pass:[url]]::remove_userinfo


Remove the userinfo


== Synopsis

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

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

== Description


This function removes the userinfo if
present, without removing any authority.

=== Example
[,cpp]
----
assert( url( "http://user@example.com" ).remove_userinfo().has_userinfo() == false );
----

=== Postconditions
[,cpp]
----
this->has_userinfo() == false && this->encoded_userinfo().empty == true
----

=== Complexity

Linear in `this-&gt;size()`.

=== Exception Safety

Throws nothing.

=== BNF
[,cpp]
----
userinfo      = [ [ user ] [ ':' password ] ]

user          = *( unreserved / pct-encoded / sub-delims )
password      = *( unreserved / pct-encoded / sub-delims / ":" )
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[            3.2.1. User Information (rfc3986)]








== See Also


xref:boost/urls/url_base/set_encoded_userinfo.adoc[set_encoded_userinfo]
,
xref:boost/urls/url_base/set_userinfo.adoc[set_userinfo]
.



