[#boost-urls-url_view_base-scheme] = xref:boost.adoc[boost]::xref:boost/urls.adoc[urls]::xref:boost/urls/url_view_base.adoc[url_view_base]::scheme :relfileprefix: ../../../ :mrdocs: Return the scheme == Synopsis Declared in `<https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_view_base.hpp#L404[boost/url/url_view_base.hpp]>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- core::string_view scheme() const noexcept; ---- == Description This function returns the scheme if it exists, without a trailing colon (':'). Otherwise it returns an empty string. Note that schemes are case‐insensitive, and the canonical form is lowercased. == Example [,cpp] ---- assert( url_view( "http://www.example.com" ).scheme() == "http" ); ---- == Exception Safety Throws nothing. == BNF [,cpp] ---- scheme = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." ) URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ] absolute-URI = scheme ":" hier-part [ "?" query ] ---- == Specification * https://datatracker.ietf.org/doc/html/rfc3986#section-3.1[] == Return Value The scheme as a string. == See Also xref:boost/urls/url_view_base/has_scheme.adoc[`has_scheme`], xref:boost/urls/url_view_base/scheme_id.adoc[`scheme_id`]. [.small]#Created with https://www.mrdocs.com[MrDocs]#