Crossware

Table of Contents        Previous topic       Next topic       

C++ COMPILER LIBRARY FUNCTIONS->String Class Functions->Member Functions->insert

#include <string>

string& insert(size_t pos1, const string& str)

Inserts into the data of an object of class string at position pos1 the data of str.

Returns a reference to the string into which the data has been assigned.

string& insert(size_t pos1, const string& str, size_t pos2, size_t n)

Inserts into the data of an object of class string at position pos1 the data of str starting at str[pos2].  The amount of data inserted is the smaller of n and str.size().

Returns a reference to the string into which the data has been assigned.

string& insert(size_t pos, const char* s, size_t n)

Inserts into the data of an object of class string at position pos the array of char of length n with a first element s.

Returns a reference to the string into which the data has been assigned.

string& insert(size_t pos, const char* s)

Inserts into the data of an object of class string at position pos the array of char of length strlen(s) with a first element s.

Returns a reference to the string into which the data has been assigned.

string& insert(size_t pos, size_t n, char c)

Inserts into the data of an object of class string at position pos n copies of c.

Returns a reference to the string into which the data has been assigned.

iterator insert(iterator p, char c)

Inserts into the data of an object of class string at iterator position p the character c.

Returns an iterator which refers to the inserted character.

void insert(iterator p, size_t n, char c)

Inserts into the data of an object of class string at iterator position p n copies of c.