string – C++ Reference

class

<string>

String class

The standard string class provides support for such objects with an interface similar to that of a

The string class is an instantiation of the char (i.e., bytes) as its character type, with its default

Note that this class handles bytes independently of the encoding used: If used to handle sequences of multi-byte or variable-length characters (such as UTF-8), all members of this class (such as

Strings are objects that represent sequences of characters.The standardclass provides support for such objects with an interface similar to that of a standard container of bytes, but adding features specifically designed to operate with strings of single-byte characters.Theclass is an instantiation of the basic_string class template that uses(i.e., bytes) as its, with its default char_traits and allocator types (see basic_string for more info on the template).Note that this class handles bytes independently of the encoding used: If used to handle sequences of multi-byte or variable-length characters (such as UTF-8), all members of this class (such as length or size ), as well as its iterators, will still operate in terms of bytes (not actual encoded characters).