#include#include #include #include "StringBuilder.h" int main() { StringBuilder sb; std::string str1 = "Hello"; std::string str2 = "world"; sb.append(str1).append(" ").append(str2); std::cout << sb.toString() << std::endl; return 0; }
#includeIn this example, a StringBuilder object is created and a string is appended to it using the append() function. Then, the insert() function is used to insert the string "beautiful " at index 6 in the StringBuilder object. The final string is then output to the console. Therefore, we can conclude that the package library used here is "StringBuilder.h".#include #include #include "StringBuilder.h" int main() { StringBuilder sb; std::string str = "Hello world!"; sb.append(str); sb.insert(6, "beautiful "); std::cout << sb.toString() << std::endl; return 0; }