Tip of the Week #124: <code>absl::StrFormat()</code>
▻https://abseil.io/tips/124
Originally posted as TotW #124 on October 11, 2016
Updated 2022-11-16
Quicklink: abseil.io/tips/124
The str_format Library and absl::StrFormat()
After a long testing and development period, we’re pleased to announce that the str_format library is now generally available. The str_format library is a very efficient, typesafe, and extensible library that implements all printf formatting syntax. Nearly all printf-style conversions can be trivially upgraded to absl::StrFormat(). For more detailed documentation, see ▻https://abseil.io/docs/cpp/guides/format. It’s the best option for printf-style formatting, but no position is taken here on where printf-style is or isn’t appropriate.
Usage is simple. Add a BUILD dependency on //third_party/absl/strings:str_format, and include the header: (...)