Please note that the content of this book primarily consists of articles
available from Wikipedia or other free sources online. In the C++
programming language, the std::string class is a standard representation
for a string of text. This class alleviates many of the problems
introduced by C-style strings by putting the onus 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 substrings. It can be constructed
from a C-style string, and a C-style string can also be obtained from
it. Because a string may be stored by value, copying may take as long as
O(n). It will also cause heap memory to be allocated, which is usually
far more expensive than the copy.