[#bsl-basic_string-0f3-assign-0a] = xref:bsl.adoc[bsl]::xref:bsl/basic_string-0f3.adoc[basic_string<char32_t>]::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<char32_t>]& assign(xref:BloombergLP/bslmf/MovableRef.adoc[BloombergLP::bslmf::MovableRef<basic_string<char32_t>>] replacement) noexcept(false); ---- [.small]#Created with https://www.mrdocs.com[MrDocs]#