使用 QString,可以执行以下操作:
QString const sentence = QString("First name: %1, Last name: %2")
.arg("John")
.arg("Doe");
// sentence is now "First name: John, Last name: Doe"
Boost/STL 有类似的东西吗?我想在不使用 sstream << 运算符的情况下以这种方式构造一个类似的字符串。
最佳答案
好像你想要boost.format
关于c++ - Boost 或 STL 是否提供类似于 QString 的功能?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4444088/