In addition to options suggested by others I can recommend the fmt library which implements string formatting similar to str.format
in Python and String.Format
in C#. Here's an example:
std::string a = "test";
std::string b = "text.txt";
std::string c = "text1.txt";
std::string result = fmt::format("{0} {1} > {2}", a, b, c);
Disclaimer: I'm the author of this library.