In the C++ programming language, the std::string class is a standard representation for a string of text. This class reduces many of the problems introduced by C-style strings by putting the responsibility of memory ownership on the
string
class rather than on the programmer. The class provides some typical string operations like comparison, concatenation, find and replace, and a function for obtaining sub-strings It can be constructed from a C-style string, and a C-style string can also be obtained from it. Here is an example C-program