[#bsl-basic_string-0faf-assign-089]
= xref:bsl.adoc[bsl]::xref:bsl/basic_string-0faf.adoc[basic&lowbar;string]::assign
:relfileprefix: ../../
:mrdocs:

Assign a new value to this string&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class INPUT&lowbar;ITER&gt;
xref:bsl/basic_string-0faf.adoc[basic&lowbar;string]&
assign(
    INPUT&lowbar;ITER first,
    INPUT&lowbar;ITER last);
----

== Description

Assign to this string the characters in the range starting at the specified `first` iterator and ending right before the specified `last` iterator of the (template parameter) type `INPUT&lowbar;ITER`&period; Return a reference providing modifiable access to this string&period; The behavior is undefined unless `first` and `last` refer to a sequence of valid values where `first` is at a position at or before `last`&period;

== Return Value

reference providing modifiable access to this string

== Parameters

[cols="1,4"]
|===
| Name| Description
| *first*
| beginning of the range (inclusive)
| *last*
| end of the range (exclusive)
|===


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