std::basic_string::insert - cppreference.com
De cppreference.com
<metanoindex/>
<tbody> </tbody>
|
|
(1) | |
|
|
(2) | |
|
|
(3) | |
|
|
(4) | |
|
|
(5) | |
|
|
(6) | (até C++11) (desde C++11) |
|
|
(7) | (até C++11) (desde C++11) |
|
|
(8) | (até C++11) (desde C++11) |
|
|
(9) | (desde C++11) |
Insere caracteres para a string:
Original:
Inserts characters into the string:
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
1)
Insere count cópias de ch personagem no index posição
Original:
Inserts count copies of character ch at the position index
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
2)
Insere seqüência de caracteres terminada em nulo apontado por s no index posição. O comprimento da corda é determinada pelo primeiro caractere nulo (efetivamente chamadas Traits::length(s).
Original:
Inserts null-terminated character string pointed to by s at the position index. The length of the string is determined by the first null character (effectively calls Traits::length(s).
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
3)
Insere os personagens count primeira da seqüência de caracteres apontada por s no index posição. s pode conter caracteres nulos.
Original:
Inserts the first count characters from the character string pointed to by s at the position index. s can contain null characters.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
4)
Insere str corda no index posição
Original:
Inserts string str at the position index
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
5)
Insere uma corda, obtidos por str.substr(index_str, count) no index posição
Original:
Inserts a string, obtained by str.substr(index_str, count) at the position index
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
6)
Insere ch personagem antes o caracter apontado por pos
Original:
Inserts character ch before the character pointed by pos
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
7)
Insere count cópias de ch personagem antes do elemento apontado por pos
Original:
Inserts count copies of character ch before the element pointed to by pos
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
8)
Insere personagens do [first, last) intervalo
Original:
Inserts characters from the range [first, last)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
9)
Insere elementos da lista de inicializador ilist.
Original:
Inserts elements from initializer list ilist.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Parâmetros
| index | - | posição na qual o conteúdo será inserido Original: position at which the content will be inserted The text has been machine-translated via Google Translate. |
| pos | - | iterador antes que os personagens serão inseridos Original: iterator before which the characters will be inserted The text has been machine-translated via Google Translate. |
| ch | - | personagem para inserir Original: character to insert The text has been machine-translated via Google Translate. |
| count | - | número de caracteres para inserir Original: number of characters to insert The text has been machine-translated via Google Translate. |
| s | - | ponteiro para a cadeia de caracteres a ser inserido Original: pointer to the character string to insert The text has been machine-translated via Google Translate. |
| str | - | string para inserir Original: string to insert The text has been machine-translated via Google Translate. |
| first, last | - | vão definir caracteres para inserir Original: range defining characters to insert The text has been machine-translated via Google Translate. |
| index_str | - | posição do primeiro caractere na seqüência Original: position of the first character in the string The text has been machine-translated via Google Translate. |
| ilist | - | inicializador lista para inserir os caracteres Original: initializer list to insert the characters from The text has been machine-translated via Google Translate. |
| Type requirements | ||
-InputIt must meet the requirements of InputIterator.
| ||
Valor de retorno
1-5) *this
6-9)
Iterator após o último caractere inserido.
Original:
Iterator following the last inserted character.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Exceções
1) std::out_of_range if index > size() and std::length_error if size() + count > max_size().
2) std::out_of_range if index > size() and std::length_error if size() + Traits::length(s) > max_size().
3) std::out_of_range if index > size() and std::length_error if size() + count > max_size().
4)
Lança exceções nas seguintes condições:
Original:
Throws exceptions on the following conditions:
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
a) std::out_of_range if index > size().
b)
std::length_error se size() + str.size() > max_size() onde ins_count é o número de caracteres que serão inseridos.
Original:
std::length_error if size() + str.size() > max_size() where ins_count is the number of characters that will be inserted.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
5)
Lança exceções nas seguintes condições:
Original:
Throws exceptions on the following conditions:
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
a) std::out_of_range if index > size().
b) std::out_of_range if index_str > str.size().
c)
std::length_error se size() + ins_count > max_size() onde ins_count é o número de caracteres que serão inseridos.
Original:
std::length_error if size() + ins_count > max_size() where ins_count is the number of characters that will be inserted.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
6-9)
(Nenhum)
Original:
(none)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Veja também
Acrescenta caracteres até o fim Original: appends characters to the end The text has been machine-translated via Google Translate. (função pública membro) [edit] | |
acrescenta um caráter até o fim Original: appends a character to the end The text has been machine-translated via Google Translate. (função pública membro) [edit] | |