iterator begin() |
Return an iterator pointing to the first character of the string |
const_iterator begin() const |
Return a const_iterator pointing to the first character of the string |
iterator end() |
Return an iterator that points one past the end of the string |
const_iterator end() const |
Return a const_iterator that points one past the end of the string |
reverse_iterator rbegin() |
Return a reverse_iterator pointing to the last character of the string |
const_reverse_iterator rbegin() const |
Return a const_reverse_iterator pointing to the last character of the string |
reverse_iterator rend() |
Return a reverse_iterator pointing one before the first character of the string |
const_reverse_iterator rend() const |
Return a const_reverse_iterator pointing one before the first character of the string |
size_type size() |
Return the number of characters in the string (does not include null termination) |
size_type length() |
Same as size() |
size_type capacity() |
Return the number of characters that can fit in the string before additional memory must be allocated |
size_type max_size() |
Return the number of bytes allocated for storage of the string. |
resize(size_type size) |
Resize the string. If extra characters are needed, a null character (\0) is used. |
resize(size_type size, char ch) |
Resize the string. If extra characters are needed, the given character will be used. |
reserve(size_type size = 0) |
Attempts to reserve memory so the string can hold the specified number of characters |
clear() |
Remove all data from the string |
bool empty() |
Return true if the string is empty |
char operator[size_type pos] |
Return the character at the given position. Dangerous. If the character does not exist, the behavior is undefined. |
char at(size_type pos) |
Return the character at the given position. If there is no such character, throw an std::out_of_range error. |
operator += (std::string& str) |
Append a string on to this one |
operator += (const char* c_str) |
Append a C style string to this string |
operator += (char ch) |
Append a character to this string |
append(std::string str) |
Append a string to this one |
append(std::string str, size_type pos, size_type n) |
Append a substring of str to this one |
append(const char* const c_str) |
Append a C style string to this one |
append(const char* const c_str, size_type len) |
Append a C style string to this one with limited length |
append(size_type count, char ch) |
Append a string consisting of repeating ch count times |
append(iterator first, iterator last) |
Append a string specified by iterators to this one |
push_back(char ch) |
Append a single character to the string |
assign(std::string str) |
Replace the string with a new one |
assign(std::string size_type pos, size_type length) |
Assign this string the value of the given substring |
assign(const char* const c_str) |
Replace the string with the given C style string |
assign(const char* const c_str, size_type length) |
Replace the string with the given C style string with limited length |
assign(size_type count, char ch) |
Replace the string with one containing ch repeated count times |
assign(iterator begin, iterator end) |
Assign the string the value of the string delimited by the iterators |
insert(iterator where, iterator begin, iterator end) |
Insert string specified by begin, end just before where |
insert(size_type where, const std::string& str) |
Insert the given string just before where |
insert(size_type where, const std::string& str, size_type start, size_type length) |
Insert the given string starting at start and going for length characters just before where |
insert(size_type where, const char* const c_str) |
Insert the C style string just before where |
insert(size_type where, const char* const c_str, size_type length) |
Insert the C style string for length characters just before the position where |
insert(size_type where, size_type count, char ch) |
Insert a string made of ch characters repeated count times just before where |
insert(iterator where, char ch) |
Insert a single character just before where. After all of the above, it hardly seems worth it. |
string = erase() |
Erase the entire string. Returns a reference to the string. |
string = erase(size_type pos) |
Erase the string from pos to the end. Returns a reference to the string. |
string = erase(size_type pos, size_type length) |
Erase the string from pos for length characters. Returns a reference to the string. |
iterator erase(iterator where) |
Erase one character. Returns the iterator where which points to the character after the erasure. |
iterator = erase(iterator start, iterator last) |
Erase from first to just before last. Returns the location of the character just after the last removal. |
string = replace(size_type where, size_type length, const std::string& str) |
Replace characters starting at where and continuing for length with the given replacement string. Returns a reference to the new string. |
string = replace(size_type where, size_type length, const std::string& c_str, size_type replace_where, size_type replace_length) |
Replace characters starting at where and continuing for length with the given replacement string starting at replace_where for replace_length. Returns a reference to the new string. |
string = replace(size_type where, size_type length, const char* const) |
Replace characters starting at where and continuing for length with the given replacement C style string. Returns a reference to the new string. |
string = replace(size_type where, size_type length, const char* const c_str, size_type replace_length) |
Replace characters starting at where and continuing for length with the given replacement C style string for replace_length. Returns a reference to the new string. |
string = replace(size_type where, size_type replace_length, size_type insert_length, char fill) |
Starting at where, replace replace_length characters with fill, then add an additional insert_length characters of fill. Returns a reference to the new string. |
string = replace(iterator begin, iterator end, const std::string& str) |
Replace the section of string from begin to just before end with str. Returns a reference to the new string. |
size_type = copy(char* out_str, size_type out_size, size_type pos = 0) const |
Copy the string into the given C style string for at most out_size characters. Copying will start at pos if specified. Returns the number of characters actually copied. |
swap(std::string str) |
Swap this string with another |
const char* c_str() |
Return a pointer to a C style string. This data is not safely modifiable. |
const char* data() |
Return a pointer to a raw data (like a C style string, but may not contain a end of string (\0) character). This data is not safely modifiable. |
size_type = find(const char* c_str, size_type pos, size_type length) |
Search for length characters of the C string starting at pos. Return the position of match or npos if none. |
size_type = find(const char* c_str, size_type pos) |
Search for the C string starting at pos. Return the position of match or npos if none. |
size_type = find(const char* c_str) |
Search for the C string starting at the beginning of the string. Return the position of match or npos if none. |
size_type = find(const char ch, size_tyep pos) |
Search for the character starting at the given position. Return the position of match or npos if none. |
size_type = find(const char ch) |
Search for the character starting at the beginning of the string. Return the position of match or npos if none. |
size_type = rfind(const char* c_str, size_type pos, size_type length) |
Search backward for length characters of the C string starting at pos. Return the position of match or npos if none. |
size_type = rfind(const char* c_str, size_type pos) |
Search backward for the C string starting at pos. Return the position of match or npos if none. |
size_type = rfind(const char* c_str) |
Search backward for the C string starting at the beginning of the string. Return the position of match or npos if none. |
size_type = rfind(const char ch, size_tyep pos) |
Search backward for the character starting at the given position. Return the position of match or npos if none. |
size_type = rfind(const char ch) |
Search backward for the character starting at the beginning of the string. Return the position of match or npos if none. |
size_type = find_first_of(const std::string str, size_type pos = 0) |
Find the first character of the string that matches any character of str starting at the given position |
size_type = find_first_of(const char* c_str, size_type pos, size_ type length) |
Find the first character of the string that matches any of the first length character of c_str starting at the given position |
size_type = find_first_of(const char* c_str, size_type pos = 0) |
Find the first character of the string that matches any character of c_str starting at the given position |
size_type = find_first_of(char ch, size_type pos = 0) |
Find the first occurrence of the character starting at the indicated position |
size_type = find_last_of(const std::string str, size_type pos = npos) |
Find the last character of the string that matches any character of str starting at the given position |
size_type = find_last_of(const char* c_str, size_type pos, size_ type length) |
Find the last character of the string that matches any of the first length character of c_str starting at the given position |
size_type = find_last_of(const char* c_str, size_type pos = npos) |
Find the last character of the string that matches any character of c_str starting at the given position |
size_type = find_last_of(char ch, size_type pos = npos) |
Find the last occurrence of the character starting at the indicated position |
size_type = find_first_not_of(const std::string str, size_type pos = 0) |
Find the first character of the string that does not match any character of str starting at the given position |
size_type = find_first_not_of(const char* c_str, size_type pos, size_ type length) |
Find the first character of the string that does not match any of the first length character of c_str starting at the given position |
size_type = find_first_not_of(const char* c_str, size_type pos = 0) |
Find the first character of the string that does not match any character of c_str starting at the given position |
size_type = find_first_not_of(char ch, size_type pos = 0) |
Find the first occurrence of anything but the given character starting at the indicated position |
size_type = find_last_not_of(const std::string str, size_type pos = npos) |
Find the last character of the string that does not match any character of str starting at the given position |
size_type = find_last_not_of(const char* c_str, size_type pos, size_ type length) |
Find the last character of the string that does not match any of the first length character of c_str starting at the given position |
size_type = find_last_not_of(const char* c_str, size_type pos = npos) |
Find the last character of the string that does not match any character of c_str starting at the given position |
size_type = find_last_not_of(char ch, size_type pos = npos) |
Find the last occurrence of anything but the given character starting at the indicated position |
std::string = substr(size_type pos = 0, size_type count = npos) |
Return a substring of the original string starting at the given position and continuing for count characters |
int = compare(const std::string& str) const |
Compare this string against the given string and returns a number <0 if this string comes before the parameter, =0 if the strings are equal, and >0 if this string comes after the parameter string |
{{ parent.title || parent.header.title}}
{{ parent.tldr }}
{{ parent.linkDescription }}
{{ parent.urlSource.name }}