Crossware

Table of Contents        Previous topic       Next topic       

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

#include <string>

string& replace(size_t pos1, size_t n1, const string& str)

Erase the smaller of n1 and size()  pos1 characters starting from pos1 replacing them with the data from str.

Returns a reference to the string in which the data has been replaced.

string& replace(size_t pos1, size_t n1, const string& str, size_t pos2, size_t n2)

Erase the smaller of n1 and size()  pos1 characters starting from pos1 replacing them with the smaller of n2 and str.size()  pos2 characters from str starting from str[pos2].

Returns a reference to the string in which the data has been replaced.

string& replace(size_t pos, size_t n1, const char* s, size_t n2)

Erase the smaller of n1 and size()  pos characters starting from pos replacing them with the array of char of size n2 whose first element is s.

Returns a reference to the string in which the data has been replaced.

string& replace(size_t pos, size_t n1, const char* s)

Erase the smaller of n1 and size()  pos characters starting from pos replacing them with the array of char of size strlen(s) whose first element is s.

Returns a reference to the string in which the data has been replaced.

string& replace(size_t pos, size_t n1, size_t n2, char c)

Erase the smaller of n1 and size()  pos characters starting from pos replacing them with n2 copies of c.

Returns a reference to the string in which the data has been replaced.

string& replace(iterator i1, iterator i2, const string& str)

Erase the characters in the range i1 to i2 replacing them with the data from str.

Returns a reference to the string in which the data has been replaced.

string& replace(iterator i1, iterator i2, const char* s, size_t n)

Erase the characters in the range i1 to i2 replacing them with the array of char of size n whose first element is s.

Returns a reference to the string in which the data has been replaced.

string& replace(iterator i1, iterator i2, const char* s)

Erase the characters in the range i1 to i2 replacing them with the array of char of size strlen(s) whose first element is s.

Returns a reference to the string in which the data has been replaced.

string& replace(iterator i1, iterator i2, size_t n, char c)

Erase the characters in the range i1 to i2 replacing them n copies of c.

Returns a reference to the string in which the data has been replaced.