|
| template<typename T> |
| std::string | to_string (T &&t) noexcept |
| | Converts a type to a string.
|
| |
| template<typename T> |
| std::string | from_container (T &&t, std::optional< char > sep=std::nullopt) noexcept |
| | Converts a container into a string if it has string convertible elements.
|
| |
| template<std::input_iterator It> |
| std::string | from_container (It &&begin, It &&end, std::optional< char > sep=std::nullopt) noexcept |
| | Converts a container into a string if it has string convertible elements.
|
| |
| template<typename... Args> |
| std::string | placeholders_replace (std::string str, Args &&... args) |
| | Replace all occurrences of "{}" placeholders in a string with provided values.
|
| |
String manipulation and conversion utilities.
This namespace provides enhanced string utilities including compile-time static strings, type-to-string conversion using concepts, container-to-string serialization, and placeholder replacement.
template<typename... Args>
| std::string ns_string::placeholders_replace |
( |
std::string | str, |
|
|
Args &&... | args ) |
|
inlinenodiscard |
Replace all occurrences of "{}" placeholders in a string with provided values.
This function iterates through the string and replaces "{}" placeholders with the provided arguments in order.
- Template Parameters
-
| Args | The types of the arguments to replace |
- Parameters
-
| str | The string containing "{}" placeholders |
| args | The values to replace placeholders with |
- Returns
- The string with placeholders replaced
Definition at line 178 of file string.hpp.