std::basic_string::operator[]

reference operator[]( size_type pos ); (1) const_reference operator[]( size_type pos ) const; (2) Returns a reference to the character at specified location pos. No bounds checking is performed. 1) If pos == size(), the behavior is undefined. 2) If pos == size(), a reference to the character with value CharT() (the null character) is returned. (until C++11) If pos == size(), a reference to the character with value CharT() (the null character) is returned. For the first

std::basic_string::pop_back

void pop_back(); (since C++11) Removes the last character from the string. Equivalent to erase(size()-1, 1), except the behavior is undefined if the string is empty. Parameters (none). Return value (none). Complexity Constant. Exceptions Does not throw. See also push_back appends a character to the end (public member function) erase removes characters (public member function)

std::basic_string::get_allocator

allocator_type get_allocator() const; Returns the allocator associated with the string. Parameters (none). Return value the associated allocator. Complexity Constant. See also allocator the default allocator (class template) allocator_traits (C++11) provides information about allocator types (class template) uses_allocator (C++11) checks if the specified type supports uses-allocator construction (class template)

std::basic_string::front

CharT& front(); (since C++11) const CharT& front() const; (since C++11) Returns reference to the first character in the string. The behavior is undefined if empty() == true. Parameters (none). Return value reference to the first character, equivalent to operator[](0). Complexity Constant. Example #include <iostream> #include <string> int main() { { std::string s("Exemplary"); char& f = s.front(); f = 'e'; std::cout <<

std::basic_string::find_last_of

size_type find_last_of( const basic_string& str, size_type pos = npos ) const; (1) size_type find_last_of( const CharT* s, size_type pos, size_type count ) const; (2) size_type find_last_of( const CharT* s, size_type pos = npos ) const; (3) size_type find_last_of( CharT ch, size_type pos = npos ) const; (4) Finds the last character equal to one of characters in the given character sequence. Exact search algorithm is not specified. The search considers only the inte

std::basic_string::find_last_not_of

size_type find_last_not_of( const basic_string& str, size_type pos = npos ) const; (1) size_type find_last_not_of( const CharT* s, size_type pos, size_type count ) const; (2) size_type find_last_not_of( const CharT* s, size_type pos = npos ) const; (3) size_type find_last_not_of( CharT ch, size_type pos = npos ) const; (4) Finds the last character equal to none of the characters in the given character sequence. The search considers only the interval [0; pos]. If th

std::basic_string::find

size_type find( const basic_string& str, size_type pos = 0 ) const; (1) size_type find( const CharT* s, size_type pos, size_type count ) const; (2) size_type find( const CharT* s, size_type pos = 0 ) const; (3) size_type find( CharT ch, size_type pos = 0 ) const; (4) Finds the first substring equal to the given character sequence. Search begins at pos, i.e. the found substring must not begin in a position preceding pos. 1) Finds the first substring equal to str.

std::basic_string::find_first_of

size_type find_first_of( const basic_string& str, size_type pos = 0 ) const; (1) size_type find_first_of( const CharT* s, size_type pos, size_type count ) const; (2) size_type find_first_of( const CharT* s, size_type pos = 0 ) const; (3) size_type find_first_of( CharT ch, size_type pos = 0 ) const; (4) Finds the first character equal to one of the characters in the given character sequence. The search considers only the interval [pos, size()). If the character is n

std::basic_string::find_first_not_of

size_type find_first_not_of( const basic_string& str, size_type pos = 0 ) const; (1) size_type find_first_not_of( const CharT* s, size_type pos, size_type count ) const; (2) size_type find_first_not_of( const CharT* s, size_type pos = 0 ) const; (3) size_type find_first_not_of( CharT ch, size_type pos = 0 ) const; (4) Finds the first character equal to none of the characters in the given character sequence. The search considers only the interval [pos, size()). If t

std::basic_string::data

const CharT* data() const; Returns pointer to the underlying array serving as character storage. The pointer is such that the range [data(); data() + size()) is valid and the values in it correspond to the values stored in the string. The returned array is not required to be null-terminated. If empty() returns true, the pointer is a non-null pointer that should not be dereferenced. (until C++11) The returned array is null-terminated, that is, data() and c_str() perform the same func