[#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;`

Copy&hyphen;assign from the specified `rhs` 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 a new value 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 a new value 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-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 a new value 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;_]#

== Return Value

* reference to this string
* reference providing modifiable access to this string

== Parameters

[cols="1,4"]
|===
| Name| Description
| *rhs*
| string whose value is assigned
| *character*
| character value
| *values*
| initializer list of characters
|===


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