[#bsl-basic_string-0faf-resize_and_overwrite] = xref:bsl.adoc[bsl]::xref:bsl/basic_string-0faf.adoc[basic_string]::resize_and_overwrite :relfileprefix: ../../ :mrdocs: Change the length of this string to the specified `newLength`, erasing characters at the end if `newLength < length()` or appending the appropriate number of characters at the end if `length() < newLength`. Subsequently, invoke the specified `operation` passing the address of the null‐terminated buffer and the adjusted length of this string as parameters. Finally, change the length of this string to the value returned by the `operation`. Throw `length_error` if `newLength > max_size()`. The behavior is undefined unless the value returned by the `operation` is less than or equal to `newLength`. == Synopsis Declared in `<bslstl_string.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class OPERATION> void resize_and_overwrite( xref:bsl/basic_string-0faf/size_type.adoc[size_type] newLength, OPERATION operation); ---- [.small]#Created with https://www.mrdocs.com[MrDocs]#