Strings library
Материал из cppreference.com
< cpp
![]() |
This page has been machine-translated from the English version of the wiki using Google Translate.
The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
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.
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. - Строки с нулевым символом - массивы символов прекращена специальным пустой символ.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.
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.
You can help to correct and verify the translation. Click here for instructions.
Определено в файле <string>
| |
Type
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> |
[править] Строки с нулевым символом
Строки с нулевым символом являются массивами символов, которые заканчиваются специальными нулевые характер. C + + предоставляет функции для создания, проверки и изменения строки с нулевым символом.
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.
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.
You can help to correct and verify the translation. Click here for instructions.
- <div class="t-tr-text"> нулем строки байт</div>Original:null-terminated byte stringsThe text has been machine-translated via [http://translate.google.com Google Translate].
You can help to correct and verify the translation. Click [http://en.cppreference.com/w/Cppreference:MachineTranslations here] for instructions. - <div class="t-tr-text"> нулем многобайтовых строк</div>Original:null-terminated multibyte stringsThe text has been machine-translated via [http://translate.google.com Google Translate].
You can help to correct and verify the translation. Click [http://en.cppreference.com/w/Cppreference:MachineTranslations here] for instructions. - <div class="t-tr-text"> нулем широкий строк</div>Original:null-terminated wide stringsThe text has been machine-translated via [http://translate.google.com Google Translate].
You can help to correct and verify the translation. Click [http://en.cppreference.com/w/Cppreference:MachineTranslations 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.
You can help to correct and verify the translation. Click here for instructions.
Заголовочный файл <string>
|
||
template<> class char_traits<std::string>; template<> class char_traits<std::wstring>; |
(начиная с C++11) (начиная с C++11) |
|