std::string

来源:互联网 发布:csp是什么软件 编辑:程序博客网 时间:2024/06/15 00:35

std::string

typedef basic_string<char> string;
String类

String是描述字符串序列的对象

标准string类提供了与标准字节容器相似的接口的对象的支持,不过添加了一些新特性用于操作单一的字节字符。

The string class is an instantiation of the basic_string class template that uses char (i.e., bytes) as its character type, 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).

请注意这个类独立于所有字节编码;如果使用多字符或可变长字符(例如UTF-8),这个类的所有成员(例如长度和大小)以及迭代器仍然以字节为单位(而不是字符编码).

成员类型


成员类型定义value_typechartraits_typechar_traits<char>allocator_typeallocator<char>referencechar&const_referenceconst char&pointerchar*const_pointerconst char*iteratora random access iterator to char (convertible to const_iterator)const_iteratora random access iterator to const char

成员函数


迭代器:

功能:

Element access:

Modifiers:

String operations:

常量成员


重载函数





原创粉丝点击