Espacios de nombres
Variantes
Acciones

std::basic_string::insert

De cppreference.com
< cpp‎ | string‎ | basic string
 
 
Strings biblioteca
Terminadas en nulo
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.
Cadenas de bytes
Multibyte cuerdas
Cadenas anchas
Clases
Original:
Classes
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
Las funciones miembro
Original:
Member functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Elemento acceso
Original:
Element access
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Los iteradores
Original:
Iterators
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Capacidad
Original:
Capacity
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Operaciones
Original:
Operations
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_string::insert
Buscar
Original:
Search
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Constantes
Original:
Constants
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Terceros funciones
Original:
Non-member functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
(C++11)(C++11)(C++11)
(C++11)(C++11)
(C++11)(C++11)(C++11)
(C++11)
(C++11)
Clases de ayuda
Original:
Helper 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& insert( size_type index, size_type count, CharT ch );
(1)
basic_string& insert( size_type index, const CharT* s );
(2)
basic_string& insert( size_type index, const CharT* s, size_type count );
(3)
basic_string& insert( size_type index, const basic_string& str );
(4)
basic_string& insert( size_type index, const basic_string& str,
                      size_type index_str, size_type count );
(5)
iterator insert( iterator pos, CharT ch );
iterator insert( const_iterator pos, CharT ch );
(6) (hasta C++11)
(desde C++11)
void insert( iterator pos, size_type count, CharT ch );
iterator insert( iterator pos, size_type count, CharT ch );
(7) (hasta C++11)
(desde C++11)
template< class InputIt >

void insert( iterator i, InputIt first, InputIt last );
template< class InputIt >

iterator insert( const_iterator i, InputIt first, InputIt last );
(8) (hasta C++11)

(desde C++11)
iterator insert( const_iterator pos, std::initializer_list<CharT> ilist );
(9) (desde C++11)
Inserta caracteres en la cadena:
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)
Inserta count copias de ch carácter en la posición index
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)
Inserta terminada en nulo cadena de caracteres apuntada por s al index posición. La longitud de la cadena se determina por el primer carácter nulo (eficazmente las llamadas 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)
Inserta los caracteres count primero de la cadena de caracteres apuntada por s en la posición index. s puede contener 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)
Inserta cadena str en la posición index
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)
Inserta una cadena, obtenidos por str.substr(index_str, count) en la posición index
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)
Inserta ch carácter antes del carácter señalado 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)
Inserta count copias de ch carácter antes del elemento apuntado 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)
Inserta los personajes de la serie [first, last)
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)
Inserta los elementos de la 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.

Contenido

[editar] Parámetros

index -
posición en la que se inserta el contenido
Original:
position at which the content 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.
pos -
iterador antes de que los personajes se insertará
Original:
iterator before which the characters 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.
ch -
carácter que desea insertar
Original:
character to insert
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
count -
número de caracteres a insertar
Original:
number of characters to insert
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
s -
puntero a la cadena de caracteres a insertar
Original:
pointer to the character string to insert
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
str -
cadena a insertar
Original:
string to insert
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
first, last -
van definiendo caracteres a insertar
Original:
range defining characters to insert
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
index_str -
posición del primer carácter en la cadena str a insertar
Original:
position of the first character in the string str to insert
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
ilist -
lista de inicializadores para insertar los caracteres de
Original:
initializer list to insert the characters from
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Requerimientos de tipo
-
InputIt debe reunir los requerimientos de InputIterator.

[editar] Valor de retorno

1-5) *this
6-9)
Iterator tras el último carácter introducido .
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.

[editar] Excepciones

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)
Emite excepciones en las siguientes condiciones:.....
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 si size() + str.size() > max_size() ins_count donde es el número de caracteres que se Se inserta .
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)
Emite excepciones en las siguientes condiciones:.....
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 si size() + ins_count > max_size() ins_count donde es el número de caracteres que se Se inserta .
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)
(Ninguno)
Original:
(none)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[editar] Ver también

añade caracteres al final
Original:
appends characters to the end
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(función miembro público) [editar]
añade un carácter a la final
Original:
appends a character to the end
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(función miembro público) [editar]