[#boost-urls-url_base-remove_userinfo]
= xref:boost.adoc[boost]::xref:boost/urls.adoc[urls]::xref:boost/urls/url_base.adoc[url&lowbar;base]::remove&lowbar;userinfo
:relfileprefix: ../../../
:mrdocs:

Remove the userinfo

== Synopsis

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

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

== Description

This function removes the userinfo if present, without removing any authority&period;

== 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&hyphen;&gt;size()`&period;

== Exception Safety
Throws nothing&period;

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

user          = *( unreserved / pct-encoded / sub-delims )
password      = *( unreserved / pct-encoded / sub-delims / ":" )
----
== Specification
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[]

== Return Value

`&ast;this`

== See Also

xref:boost/urls/url_base/set_encoded_userinfo.adoc[`set&lowbar;encoded&lowbar;userinfo`], xref:boost/urls/url_base/set_userinfo.adoc[`set&lowbar;userinfo`]&period;


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