[#absl-StrReplaceAll-04] = xref:absl.adoc[absl]::StrReplaceAll :relfileprefix: ../ :mrdocs: Overload of `StrReplaceAll()` to replace patterns within a given output string _in place_ with replacements provided within a container of key/value pairs. == Synopsis Declared in `<absl/strings/str_replace.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename StrToStrMapping> int StrReplaceAll( StrToStrMapping const& replacements, std::string* target); ---- == Description Example: std::string s = std::string("if (ptr < &foo)"); int count = absl::StrReplaceAll({{"&", "&amp;"}, {"<", "&lt;"}, {">", "&gt;"}}, &s); EXPECT_EQ(count, 2); EXPECT_EQ("if (ptr &lt; &amp;foo)", s); == Return Value The number of substitutions that occurred. == Parameters [cols="1,4"] |=== | Name| Description | *replacements* | The container of key/value pairs of sequences to replace. | *target* | The string to modify in place. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#