[#bsl-operator_S-033]
= xref:bsl.adoc[bsl]::operator&quot;&quot;&lowbar;S
:relfileprefix: ../
:mrdocs:

Create a file&hyphen;scope string from a user&hyphen;defined literal&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/string.adoc[string]
operator&quot;&quot;&lowbar;S(
    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 object of the indicated return type&period; Use the `bslma&colon;&colon;Default&colon;&colon;globalAllocator()` to supply memory&period; (See the &quot;Memory Allocation For a File&hyphen;Scope Strings&quot; section in the component&hyphen;level documentation&period;)

Example&colon; &grave; using namespace bsl&colon;&colon;string&lowbar;literals&semi; static const bsl&colon;&colon;string g&lowbar;str1 &equals; &quot;1230abc&quot;&lowbar;S&semi; static const bsl&colon;&colon;wstring g&lowbar;str2 &equals; L&quot;1230abc&quot;&lowbar;S&semi; &grave;

== Return Value

string constructed from the character literal

== Parameters

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


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