[#bsl-basic_string-0faf-operator_assign-00]
= xref:bsl.adoc[bsl]::xref:bsl/basic_string-0faf.adoc[basic&lowbar;string]::operator&equals;
:relfileprefix: ../../
:mrdocs:

Assignment operators

== Synopses

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

Assign to this string the value of the specified `rhs` string, propagate to this object the allocator of `rhs` if the `ALLOCATOR` type has trait `propagate&lowbar;on&lowbar;container&lowbar;copy&lowbar;assignment`, and return a reference providing modifiable access to this string&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/basic_string-0faf.adoc[basic&lowbar;string]&
xref:bsl/basic_string-0faf/operator_assign-08.adoc[operator&equals;](xref:bsl/basic_string-0faf.adoc[basic&lowbar;string] const& rhs);
----

[.small]#xref:bsl/basic_string-0faf/operator_assign-08.adoc[_» more&period;&period;&period;_]#

Assign to this string the value of the string of length one consisting of the specified `character`, and return a reference providing modifiable access to this string&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/basic_string-0faf.adoc[basic&lowbar;string]&
xref:bsl/basic_string-0faf/operator_assign-01.adoc[operator&equals;](CHAR&lowbar;TYPE character);
----

[.small]#xref:bsl/basic_string-0faf/operator_assign-01.adoc[_» more&period;&period;&period;_]#

Move&hyphen;assign from the specified `rhs` string and return `&ast;this`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/basic_string-0faf.adoc[basic&lowbar;string]&
xref:bsl/basic_string-0faf/operator_assign-06a.adoc[operator&equals;](xref:BloombergLP/bslmf/MovableRef.adoc[BloombergLP::bslmf::MovableRef&lt;basic&lowbar;string&gt;] rhs) noexcept(&sol;&ast; see-below &ast;&sol;);
----

[.small]#xref:bsl/basic_string-0faf/operator_assign-06a.adoc[_» more&period;&period;&period;_]#

Assign to this string the value resulting from first clearing this string and then inserting (in order) each `CHAR&lowbar;TYPE` object in the specified `values` initializer list&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/basic_string-0faf.adoc[basic&lowbar;string]&
xref:bsl/basic_string-0faf/operator_assign-07.adoc[operator&equals;](std::initializer&lowbar;list&lt;CHAR&lowbar;TYPE&gt; values);
----

[.small]#xref:bsl/basic_string-0faf/operator_assign-07.adoc[_» more&period;&period;&period;_]#

Assign to this string the value of the specified null&hyphen;terminated `rhs` string (of length `CHAR&lowbar;TRAITS&colon;&colon;length(characterString)`), and return a reference providing modifiable access to this string&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/basic_string-0faf.adoc[basic&lowbar;string]&
xref:bsl/basic_string-0faf/operator_assign-064.adoc[operator&equals;](CHAR&lowbar;TYPE const* rhs);
----

[.small]#xref:bsl/basic_string-0faf/operator_assign-064.adoc[_» more&period;&period;&period;_]#

Assign to this string the value of the specified `rhs` object, and return a reference providing modifiable access to this string&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class STRING&lowbar;VIEW&lowbar;LIKE&lowbar;TYPE&gt;
xref:bsl/basic_string-0faf.adoc[basic&lowbar;string]&
xref:bsl/basic_string-0faf/operator_assign-038.adoc[operator&equals;](STRING&lowbar;VIEW&lowbar;LIKE&lowbar;TYPE const& rhs);
----

[.small]#xref:bsl/basic_string-0faf/operator_assign-038.adoc[_» more&period;&period;&period;_]#

Assign to this string the value of the specified `rhs` string, and return a reference providing modifiable access to this string&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class ALLOC2&gt;
xref:bsl/basic_string-0faf.adoc[basic&lowbar;string]&
xref:bsl/basic_string-0faf/operator_assign-034.adoc[operator&equals;](std::basic&lowbar;string&lt;CHAR&lowbar;TYPE, CHAR&lowbar;TRAITS, ALLOC2&gt; const& rhs);
----

[.small]#xref:bsl/basic_string-0faf/operator_assign-034.adoc[_» more&period;&period;&period;_]#


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