[#bsl-operator_sv-0c]
= xref:bsl.adoc[bsl]::operator&quot;&quot;&lowbar;sv
:relfileprefix: ../
:mrdocs:

User&hyphen;defined literal creating a `string&lowbar;view` from a character sequence&period;

== Synopsis

Declared in `&lt;bslstl&lowbar;stringview&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
std::string&lowbar;view
operator&quot;&quot;&lowbar;sv(
    char const* characterString,
    std::size&lowbar;t length);
----

== Description

Convert a character sequence of the specified `length` excluding the terminating null character starting at the beginning of the specified `characterString` to a string&lowbar;view object of the indicated return type&period; (See the &quot;User&hyphen;Defined Literals&quot; section in the component&hyphen;level documentation&period;)

Example&colon; &grave; using namespace bsl&colon;&colon;string&lowbar;view&lowbar;literals&semi; bsl&colon;&colon;string&lowbar;view sv1 &equals; &quot;1230abc&quot;&semi; bsl&colon;&colon;string&lowbar;view sv2 &equals; &quot;1230abc&quot;&lowbar;sv&semi; assert(3 &equals;&equals; sv1&period;size())&semi; assert(7 &equals;&equals; sv2&period;size())&semi;

bsl&colon;&colon;wstring&lowbar;view sv3 &equals; L&quot;1230abc&quot;&lowbar;sv&semi; assert(7 &equals;&equals; sv3&period;size())&semi; &grave;

== Return Value

`string&lowbar;view` referring to the character sequence

== Parameters

[cols="1,4"]
|===
| Name| Description
| *characterString*
| character sequence to convert
| *length*
| number of characters excluding the terminating null
|===


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