[#absl-StrReplaceAll-0e8]
= xref:absl.adoc[absl]::StrReplaceAll
:relfileprefix: ../
:mrdocs:

`StrReplaceAll` overloads

== Synopses

Declared in `&lt;absl&sol;strings&sol;str&lowbar;replace&period;h&gt;`

Replaces character sequences within a given string with replacements provided within an initializer list of key&sol;value pairs&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
&lsqb;&lsqb;nodiscard&rsqb;&rsqb;
std::string
xref:absl/StrReplaceAll-0ee.adoc[StrReplaceAll](
    std::string&lowbar;view s,
    std::initializer&lowbar;list&lt;std::pair&lt;std::string&lowbar;view, std::string&lowbar;view&gt;&gt; replacements);
----

[.small]#xref:absl/StrReplaceAll-0ee.adoc[_» more&period;&period;&period;_]#

Overload of `StrReplaceAll()` to replace character sequences within a given output string _in place_ with replacements provided within an initializer list of key&sol;value pairs, returning the number of substitutions that occurred&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
int
xref:absl/StrReplaceAll-0ea.adoc[StrReplaceAll](
    std::initializer&lowbar;list&lt;std::pair&lt;std::string&lowbar;view, std::string&lowbar;view&gt;&gt; replacements,
    std::string* target);
----

[.small]#xref:absl/StrReplaceAll-0ea.adoc[_» more&period;&period;&period;_]#

Overload of `StrReplaceAll()` to accept a container of key&sol;value replacement pairs (typically either an associative map or a `std&colon;&colon;vector` of `std&colon;&colon;pair` elements)&period; A vector of pairs is generally more efficient&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;typename StrToStrMapping&gt;
std::string
xref:absl/StrReplaceAll-0c.adoc[StrReplaceAll](
    std::string&lowbar;view s,
    StrToStrMapping const& replacements);
----

[.small]#xref:absl/StrReplaceAll-0c.adoc[_» more&period;&period;&period;_]#

Overload of `StrReplaceAll()` to replace patterns within a given output string _in place_ with replacements provided within a container of key&sol;value pairs&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;typename StrToStrMapping&gt;
int
xref:absl/StrReplaceAll-04.adoc[StrReplaceAll](
    StrToStrMapping const& replacements,
    std::string* target);
----

[.small]#xref:absl/StrReplaceAll-04.adoc[_» more&period;&period;&period;_]#

== Return Value

* A new string with the replacements applied&period;
* The number of substitutions that occurred&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *s*
| The string to search for replacements&period;
| *replacements*
| The key&sol;value pairs of sequences to replace&period;
| *target*
| The string to modify in place&period;
|===


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