[#boost-urls-pct_string_view-decode] = xref:boost.adoc[boost]::xref:boost/urls.adoc[urls]::xref:boost/urls/pct_string_view.adoc[pct_string_view]::decode :relfileprefix: ../../../ :mrdocs: Return the string with percent‐decoding == Synopsis Declared in `<https://www.github.com/boostorg/url/blob/develop/include/boost/url/pct_string_view.hpp#L334[boost/url/pct_string_view.hpp]>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<xref:boost/urls/string_token.adoc[string_token]::xref:boost/urls/string_token/StringToken.adoc[StringToken] StringToken = xref:boost/urls/string_token.adoc[string_token]::xref:boost/urls/string_token/return_string.adoc[return_string]> StringToken::result_type decode( xref:boost/urls/encoding_opts.adoc[encoding_opts] opt = {}, StringToken&& token); ---- == Description This function converts percent escapes in the string into ordinary characters and returns the result. When called with no arguments, the return type is `std::string`. Otherwise, the return type and style of output is determined by which string token is passed. === Example [,cpp] ---- assert( pct_string_view( "Program%20Files" ).decode() == "Program Files" ); ---- === Complexity Linear in `this‐>size()`. === Exception Safety Calls to allocate may throw. String tokens may throw exceptions. == Parameters |=== | Name | Description | *opt* | The options for encoding. If this parameter is omitted, the default options are used. | *token* | An optional string token. If this parameter is omitted, then a new `std::string` is returned. Otherwise, the function return type is the result type of the token. |=== == See Also xref:boost/urls/encoding_opts.adoc[encoding_opts], xref:boost/urls/string_token/return_string.adoc[string_token::return_string]. [.small]#Created with https://www.mrdocs.com[MrDocs]#