:relfileprefix: ../../../ [#boost-urls-url-remove_port] = xref:boost.adoc[pass:[boost]]::xref:boost/urls.adoc[pass:[urls]]::xref:boost/urls/url.adoc[pass:[url]]::remove_port Remove the port == Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost/urls/url.adoc[url]& remove_port() noexcept; ---- == Description If a port exists, it is removed. The rest of the authority is unchanged. === Example [,cpp] ---- assert( url( "http://www.example.com:80" ).remove_port().authority().buffer() == "www.example.com" ); ---- === Postconditions [,cpp] ---- this->has_port() == false && this->port_number() == 0 && this->port() == "" ---- === Complexity Linear in `this->size()`. === Exception Safety Throws nothing. === BNF [,cpp] ---- authority = [ userinfo "@" ] host [ ":" port ] port = *DIGIT ---- === Specification * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.3[ 3.2.3. Port (rfc3986)] == See Also xref:boost/urls/url_base/set_port.adoc[set_port] .