Standard C++ Library Reference ISO/IEC (VERSION3)

size_type find_last_not_of(value_type ch,
size_type off = npos) const;
basic_string substr(size_type off = 0,
size_type count = npos) const;
int compare(const basic_string& right) const;
int compare(size_type off, size_type n0,
const basic_string& right);
int compare(size_type off, size_type n0,
const basic_string& right, size_type roff,
size_type count);
int compare(const value_type *ptr) const;
int compare(size_type off, size_type n0,
const value_type *ptr) const;
int compare(size_type off, size_type n0,
const value_type *ptr, size_type off) const;
allocator_type get_allocator() const;
};
The template class describes an object that controls a varying-length sequence of elements of type
Elem, also known as value_type. Such an element type must not require explicit construction
or destruction, and it must be suitable for use as the Elem parameter to basic_istream or
basic_ostream. (A ``plain old data structure,'' or POD, from C generally meets this criterion.)
The Standard C++ library provides two specializations of this template class, with the type
definitions string, for elements of type char, and wstring, for elements of type wchar_t.
Various important properties of the elements in a basic_string specialization are described
by the class Tr, also known as traits_type. A class that specifies these character traits must
have the same external interface as an object of template class char_traits.
The object allocates and frees storage for the sequence it controls through a stored allocator object
of class Alloc, also known as allocator_type. Such an allocator object must have the same
external interface as an object of template class allocator. (Class char_traits has no
provision for alternate addressing schemes, such as might be required to implement a far heap.)
Note that the stored allocator object is not copied when the container object is assigned.
The sequences controlled by an object of template class basic_string are usually called
strings. These objects should not be confused, however, with the null-terminated C strings used
throughout the Standard C++ library.
Many member functions require an operand sequence of elements. You can specify such an
operand sequence several ways:
ch -- one element with value ch
count, ch -- a repetition of count elements each with value ch
ptr -- a null-terminated sequence (such as a C string, for Elem of type char) beginning at