std::basic_string::resize
来自cppreference.com
< cpp | string | basic string
|
|
该页由英文版wiki使用Google Translate机器翻译而来。
该翻译可能存在错误或用词不当。鼠标停留在文本上可以看到原版本。你可以帮助我们修正错误或改进翻译。参见说明请点击这里. |
| void resize( size_type count ); |
(1) | |
| void resize( size_type count, CharT ch ); |
(2) | |
将字符串包含
count人物.原文:
Resizes the string to contain
count characters.如果电流的大小小于
count,其他字符追加.原文:
If the current size is less than
count, additional characters are appended.如果电流的大小大于
count,该字符串是它的第一个count元素.原文:
If the current size is greater than
count, the string is reduced to its first count elements.第一个版本,初始化新的字符CharT(),第二个版本初始化新的字符
ch.原文:
The first version initializes new characters to CharT(), the second version initializes new characters to
ch.目录 |
[编辑] 参数
| count | - | 新的字符串的长度
|
| ch | - | 字符初始化新的字符
原文: character to initialize the new characters with |
[编辑] 返回值
(无)
[编辑] 复杂度
线性的字符串的大小
[编辑] 另请参阅
| 返回字符数量 (公开成员函数) |