[#bsl-basic_string-0faf-replace-06] = xref:bsl.adoc[bsl]::xref:bsl/basic_string-0faf.adoc[basic_string]::replace :relfileprefix: ../../ :mrdocs: `replace` overloads == Synopses Declared in `<bslstl_string.h>` Replace a substring of this string. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/basic_string-0faf.adoc[basic_string]& xref:bsl/basic_string-0faf/replace-0f.adoc[replace]( xref:bsl/basic_string-0faf/const_iterator.adoc[const_iterator] first, xref:bsl/basic_string-0faf/const_iterator.adoc[const_iterator] last, xref:bsl/basic_string-0faf.adoc[basic_string] const& replacement); ---- [.small]#xref:bsl/basic_string-0faf/replace-0f.adoc[_» more..._]# Replace a substring of this string. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/basic_string-0faf.adoc[basic_string]& xref:bsl/basic_string-0faf/replace-024.adoc[replace]( xref:bsl/basic_string-0faf/const_iterator.adoc[const_iterator] first, xref:bsl/basic_string-0faf/const_iterator.adoc[const_iterator] last, CHAR_TYPE const* characterString); ---- [.small]#xref:bsl/basic_string-0faf/replace-024.adoc[_» more..._]# Replace a substring of this string. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/basic_string-0faf.adoc[basic_string]& xref:bsl/basic_string-0faf/replace-021.adoc[replace]( xref:bsl/basic_string-0faf/size_type.adoc[size_type] outPosition, xref:bsl/basic_string-0faf/size_type.adoc[size_type] outNumChars, xref:bsl/basic_string-0faf.adoc[basic_string] const& replacement); ---- [.small]#xref:bsl/basic_string-0faf/replace-021.adoc[_» more..._]# Replace a substring of this string. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/basic_string-0faf.adoc[basic_string]& xref:bsl/basic_string-0faf/replace-03f.adoc[replace]( xref:bsl/basic_string-0faf/size_type.adoc[size_type] outPosition, xref:bsl/basic_string-0faf/size_type.adoc[size_type] outNumChars, CHAR_TYPE const* characterString); ---- [.small]#xref:bsl/basic_string-0faf/replace-03f.adoc[_» more..._]# Replace a substring of this string. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class STRING_VIEW_LIKE_TYPE> xref:bsl/basic_string-0faf.adoc[basic_string]& xref:bsl/basic_string-0faf/replace-030.adoc[replace]( xref:bsl/basic_string-0faf/const_iterator.adoc[const_iterator] first, xref:bsl/basic_string-0faf/const_iterator.adoc[const_iterator] last, STRING_VIEW_LIKE_TYPE const& replacement); ---- [.small]#xref:bsl/basic_string-0faf/replace-030.adoc[_» more..._]# Replace a substring with the specified `replacement`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class STRING_VIEW_LIKE_TYPE> xref:bsl/basic_string-0faf.adoc[basic_string]& xref:bsl/basic_string-0faf/replace-094.adoc[replace]( xref:bsl/basic_string-0faf/size_type.adoc[size_type] outPosition, xref:bsl/basic_string-0faf/size_type.adoc[size_type] outNumChars, STRING_VIEW_LIKE_TYPE const& replacement); ---- [.small]#xref:bsl/basic_string-0faf/replace-094.adoc[_» more..._]# Replace a substring of this string. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/basic_string-0faf.adoc[basic_string]& xref:bsl/basic_string-0faf/replace-093.adoc[replace]( xref:bsl/basic_string-0faf/const_iterator.adoc[const_iterator] first, xref:bsl/basic_string-0faf/const_iterator.adoc[const_iterator] last, xref:bsl/basic_string-0faf/size_type.adoc[size_type] numChars, CHAR_TYPE character); ---- [.small]#xref:bsl/basic_string-0faf/replace-093.adoc[_» more..._]# Replace a substring of this string. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/basic_string-0faf.adoc[basic_string]& xref:bsl/basic_string-0faf/replace-0b.adoc[replace]( xref:bsl/basic_string-0faf/const_iterator.adoc[const_iterator] first, xref:bsl/basic_string-0faf/const_iterator.adoc[const_iterator] last, CHAR_TYPE const* characterString, xref:bsl/basic_string-0faf/size_type.adoc[size_type] numChars); ---- [.small]#xref:bsl/basic_string-0faf/replace-0b.adoc[_» more..._]# Replace a substring of this string. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/basic_string-0faf.adoc[basic_string]& xref:bsl/basic_string-0faf/replace-039.adoc[replace]( xref:bsl/basic_string-0faf/size_type.adoc[size_type] outPosition, xref:bsl/basic_string-0faf/size_type.adoc[size_type] outNumChars, xref:bsl/basic_string-0faf/size_type.adoc[size_type] numChars, CHAR_TYPE character); ---- [.small]#xref:bsl/basic_string-0faf/replace-039.adoc[_» more..._]# Replace a substring of this string. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/basic_string-0faf.adoc[basic_string]& xref:bsl/basic_string-0faf/replace-0d.adoc[replace]( xref:bsl/basic_string-0faf/size_type.adoc[size_type] outPosition, xref:bsl/basic_string-0faf/size_type.adoc[size_type] outNumChars, CHAR_TYPE const* characterString, xref:bsl/basic_string-0faf/size_type.adoc[size_type] numChars); ---- [.small]#xref:bsl/basic_string-0faf/replace-0d.adoc[_» more..._]# Replace a substring of this string. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class INPUT_ITER> xref:bsl/basic_string-0faf.adoc[basic_string]& xref:bsl/basic_string-0faf/replace-041.adoc[replace]( xref:bsl/basic_string-0faf/const_iterator.adoc[const_iterator] first, xref:bsl/basic_string-0faf/const_iterator.adoc[const_iterator] last, INPUT_ITER stringFirst, INPUT_ITER stringLast); ---- [.small]#xref:bsl/basic_string-0faf/replace-041.adoc[_» more..._]# Replace a substring of this string. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/basic_string-0faf.adoc[basic_string]& xref:bsl/basic_string-0faf/replace-045.adoc[replace]( xref:bsl/basic_string-0faf/size_type.adoc[size_type] outPosition, xref:bsl/basic_string-0faf/size_type.adoc[size_type] outNumChars, xref:bsl/basic_string-0faf.adoc[basic_string] const& replacement, xref:bsl/basic_string-0faf/size_type.adoc[size_type] position, xref:bsl/basic_string-0faf/size_type.adoc[size_type] numChars = npos); ---- [.small]#xref:bsl/basic_string-0faf/replace-045.adoc[_» more..._]# Replace a substring of this string. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class STRING_VIEW_LIKE_TYPE> xref:bsl/basic_string-0faf.adoc[basic_string]& xref:bsl/basic_string-0faf/replace-09d.adoc[replace]( xref:bsl/basic_string-0faf/size_type.adoc[size_type] outPosition, xref:bsl/basic_string-0faf/size_type.adoc[size_type] outNumChars, STRING_VIEW_LIKE_TYPE const& replacement, xref:bsl/basic_string-0faf/size_type.adoc[size_type] position, xref:bsl/basic_string-0faf/size_type.adoc[size_type] numChars = npos); ---- [.small]#xref:bsl/basic_string-0faf/replace-09d.adoc[_» more..._]# == Return Value * reference providing modifiable access to this string * reference to this string == Parameters [cols="1,4"] |=== | Name| Description | *first* | beginning of the range (inclusive) | *last* | end of the range (exclusive) | *replacement* | replacement character sequence | *characterString* | pointer to characters | *outPosition* | index at which replacement begins | *outNumChars* | number of characters to replace | *numChars* | number of characters | *character* | character value | *stringFirst* | beginning of the replacement range | *stringLast* | end of the replacement range | *position* | starting index |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#