std::basic_string::max_size

size_type max_size() const; Returns the maximum number of elements the string is able to hold due to system or library implementation limitations, i.e. ​std::distance(begin(), end())​ for the largest string. Parameters (none). Return value Maximum number of characters. Exceptions (none) (until C++11) noexcept specification: noexcept (since C++11) Complexity Constant. Example #include <iostream> #include <string> int main() { std::string s;

std::basic_string::insert

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) (5) basic_string& insert( size_type index, const basic_string& str, size_type index_str, size_type count ); (until C++14) basic_string&a

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_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::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::erase

basic_string& erase( size_type index = 0, size_type count = npos ); (1) (2) iterator erase( iterator position ); (until C++11) iterator erase( const_iterator position ); (since C++11) (3) iterator erase( iterator first, iterator last ); (until C++11) iterator erase( const_iterator first, const_iterator last ); (since C++11) Removes specified characters from the string. 1) Removes min(count, size() - index) characters starting at index. 2) Removes the charac