#includeint main() { boost::text::string s = "Hello, world!"; std::cout << s << std::endl; return 0; }
#includeint main() { std::string name = "John"; int age = 25; std::string message = fmt::format("My name is {} and I am {} years old.", name, age); std::cout << message << std::endl; return 0; }
#includeThis example demonstrates some of the basic operations that can be performed using std::string in C++.int main() { std::string s = "Hello, world!"; std::cout << s.length() << std::endl; std::cout << s.substr(0, 5) << std::endl; std::cout << s.find("world") << std::endl; return 0; }