Appends to a dst string given a format string, and zero or more additional arguments, returning *dst as a convenience for chaining purposes.
Declared in <absl/strings/str_format.h>
template<typename... Args>
std::string&
StrAppendFormat(
std::string* dst,
FormatSpec<Args...> const& format,
Args const&... args);
Appends nothing in case of error (but possibly alters its capacity).
Example:
std::string orig("For example PI is approximately "); std::cout << StrAppendFormat(&orig, "%12.6f", 3.14);
A reference to *dst.
| Name | Description |
|---|---|
| dst | The string to append to. |
| format | The format string. |
| args | The arguments substituted into the format string. |