[#absl-StrReplaceAll-0e8] = xref:absl.adoc[absl]::StrReplaceAll :relfileprefix: ../ :mrdocs: `StrReplaceAll` overloads == Synopses Declared in `<absl/strings/str_replace.h>` Replaces character sequences within a given string with replacements provided within an initializer list of key/value pairs. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- [[nodiscard]] std::string xref:absl/StrReplaceAll-0ee.adoc[StrReplaceAll]( std::string_view s, std::initializer_list<std::pair<std::string_view, std::string_view>> replacements); ---- [.small]#xref:absl/StrReplaceAll-0ee.adoc[_» more..._]# Overload of `StrReplaceAll()` to replace character sequences within a given output string _in place_ with replacements provided within an initializer list of key/value pairs, returning the number of substitutions that occurred. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- int xref:absl/StrReplaceAll-0ea.adoc[StrReplaceAll]( std::initializer_list<std::pair<std::string_view, std::string_view>> replacements, std::string* target); ---- [.small]#xref:absl/StrReplaceAll-0ea.adoc[_» more..._]# Overload of `StrReplaceAll()` to accept a container of key/value replacement pairs (typically either an associative map or a `std::vector` of `std::pair` elements). A vector of pairs is generally more efficient. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename StrToStrMapping> std::string xref:absl/StrReplaceAll-0c.adoc[StrReplaceAll]( std::string_view s, StrToStrMapping const& replacements); ---- [.small]#xref:absl/StrReplaceAll-0c.adoc[_» more..._]# Overload of `StrReplaceAll()` to replace patterns within a given output string _in place_ with replacements provided within a container of key/value pairs. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename StrToStrMapping> int xref:absl/StrReplaceAll-04.adoc[StrReplaceAll]( StrToStrMapping const& replacements, std::string* target); ---- [.small]#xref:absl/StrReplaceAll-04.adoc[_» more..._]# == Return Value * A new string with the replacements applied. * The number of substitutions that occurred. == Parameters [cols="1,4"] |=== | Name| Description | *s* | The string to search for replacements. | *replacements* | The key/value pairs of sequences to replace. | *target* | The string to modify in place. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#