开发者

how to append two string?

开发者 https://www.devze.com 2023-02-15 06:34 出处:网络
i have one string variable svcName=\"serviceName\" and i have to appe开发者_开发技巧nd \"Base\" this string at the end of svcName string. and store into another string.#include <string>

i have one string variable svcName="serviceName" and i have to appe开发者_开发技巧nd "Base" this string at the end of svcName string. and store into another string.


#include <string>
std::string s = "abc";
s += "def";


string::append


If you require more complex string building, you could also use an std::stringstream.

0

精彩评论

暂无评论...
验证码 换一张
取 消