Strings library

来自cppreference.com
< cpp
 
 
字符串库
null结尾的字符串
Original:
Null-terminated strings
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
字节的字符串
多字节字符串
宽字符串
Original:
Classes
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_string
char_traits
 
C + +字符串库包括支持两个一般类型的字符串
Original:
The C++ strings library includes support for two general types of strings:
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
  • std::basic_string - 设计一个模板类来处理字符串的任何字符类型.
    Original:
    std::basic_string - a templated class designed to manipulate strings of any character type.
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • NULL结尾的字符串 - 由一个特殊的“空”字符结尾的字符数组.
    Original:
    Null-terminated strings - arrays of characters terminated by a special null character.
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.

目录

[编辑] std::basic_string

模板类std::basic_string概括了如何操纵和存储的字符序列。字符串创建,操纵和破坏,都是通过一个方便的设置的类的方法和相关的功能.
Original:
The templated class std::basic_string generalizes how sequences of characters are manipulated and stored. String creation, manipulation, and destruction are all handled by a convenient set of class methods and related functions.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
一些专业std::basic_string提供常用的类型
Original:
Several specializations of std::basic_string are provided for commonly-used types:
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Defined in header <string>
类型
Original:
Type
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Definition
std::string std::basic_string<char>
std::wstring std::basic_string<wchar_t>
std::u16string std::basic_string<char16_t>
std::u32string std::basic_string<char32_t>

[编辑] null结尾的字符串

null结尾的字符串数组,通过一个特殊的“空”字符的字符被终止。 C + +提供的功能来创建,检查和修改null结尾的字符串.
Original:
Null-terminated strings are arrays of characters that are terminated by a special null character. C++ provides functions to create, inspect, and modify null-terminated strings.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
有三种类型的空终止字符串
Original:
There are three types of null-terminated strings:
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[编辑] 额外的支持

[编辑] char_traits

的字符串库还提供了类的模板char_traits,定义类型和函数std::basic_string。以下专业的定义
Original:
The string library also provides class template char_traits that defines types and functions for std::basic_string. The following specializations are defined:
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Defined in header <string>
template<> class char_traits<std::string>;

template<> class char_traits<std::wstring>;
template<> class char_traits<std::u16string>;

template<> class char_traits<std::u32string>;


(C++11 起)
(C++11 起)