absl::Substitute

Overload of Substitute() that fails to compile when the number of placeholders does not match the number of arguments.

Synopsis

Declared in <absl/strings/substitute.h>

std::string
Substitute(
    char const* format,
    /* implementation-defined */ const& a0,
    /* implementation-defined */ const& a1,
    /* implementation-defined */ const& a2);

Return Value

The formatted string.

Parameters

NameDescription
formatThe format string with $0-$9 placeholders.
a0Substitution argument for $0.
a1Substitution argument for $1.
a2Substitution argument for $2.