[#bsl-basic_string-0faf-assign-04] = xref:bsl.adoc[bsl]::xref:bsl/basic_string-0faf.adoc[basic_string]::assign :relfileprefix: ../../ :mrdocs: Assign to this string the value of the specified `replacement` string, propagate to this object the allocator of `replacement` if the `ALLOCATOR` type has trait `propagate_on_container_move_assignment`, and return a reference providing modifiable access to this string. The content of `replacement` is moved (in constant time) to this string if `get_allocator() == rhs.get_allocator()` (after accounting for the aforementioned trait). `replacement` is left in a valid but unspecified state. Note that this method has exactly the same behavior as the corresponding `operator=`. == Synopsis Declared in `<bslstl_string.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/basic_string-0faf.adoc[basic_string]& assign(xref:BloombergLP/bslmf/MovableRef.adoc[BloombergLP::bslmf::MovableRef<basic_string>] replacement) noexcept(false); ---- [.small]#Created with https://www.mrdocs.com[MrDocs]#