Strings

#include <string>

std::string hello ("Hello, World!");
std::string typedef std::basic_string<char>
public:
typedef Traits::size_type; size_type
typedef Traits::value_type; value_type
typedef Traits::allocator_type; allocator_type
typedef RandomAccessIteratoriterator
static const size_typenpos = -1;
Konstruktion
string ();
string (const string & right);
string (const string & right, size_type roff, size_type count = npos);
string (const string & right, size_type roff, size_type count,
 const allocator_type & allocator);
string (const char * ptr);
string (const char * ptr, size_type count);
string (const char * ptr, size_type count,
 const allocator_type & alloc);
string (const char * ptr, const allocator_type & alloc);
string (size_type count, char ch);
string (size_type count, char ch,
 const allocator_type & alloc);
string<InputIterator> (InputIterator first, InputIterator last);
string<InputIterator> (InputIterator first, InputIterator last,
 const allocator_type & alloc);
explicit string (const allocator_type & alloc);
string & operator= (const string & right);
string & operator= (const char * ptr);
string & operator= (char ch);
Iteration
iterator begin ();
iterator end ();
reverse_iterator rbegin ();
reverse_iterator rend ();
Kapazität
bool empty () const;
size_type length () const;
size_type size () const;
size_type max_size () const;
void resize (size_type newsize, char ch = char ());
size_type capacity () const;
void reserve (size_type count = 0);
Elementzugriff
reference operator[] (size_type off);
reference at (size_type off);
const char * c_str () const;
const char * data () const;
Modifikation
string & operator+= (const string & right);
string & operator+= (const char * ptr);
string & operator+= (char ch);
string & append (const string & right);
string & append (const string & right, size_type roff, size_type count);
string & append (const char * ptr, size_type count);
string & append (const char * ptr);
string & append (size_type count, char ch);
string & append<InputIterator> (InputIterator first, InputIterator last);
string & assign (const string & right);
string & assign (const string & right, size_type roff, size_type count);
string & assign (const char * ptr, size_type count);
string & assign (const char * ptr);
string & assign (size_type count, char ch);
string & assign<InputIterator> (InputIterator first, InputIterator last);
string & insert (size_type off, const string & right);
string & insert (size_type off, const string & right, size_type roff, size_type count);
string & insert (size_type off, const char * ptr, size_type count);
string & insert (size_type off, const char * ptr);
string & insert (size_type off, size_type count, char ch);
iterator insert (iterator where, char ch = char ());
void insert (iterator where, size_type count, char ch);
void insert<InputIterator> (iterator where, InputIterator first, InputIterator last);
string & erase (size_type off = 0, size_type count = npos);
iterator erase (iterator where);
iterator erase (iterator first, iterator last);
string & replace (size_type off, size_type n0, const string & right);
string & replace (size_type off, size_type n0, const string & right, size_type roff, size_type count);
string & replace (size_type off, size_type n0, const char * ptr, size_type count);
string & replace (size_type off, size_type n0, const char * ptr);
string & replace (size_type off, size_type n0, size_type count, char ch);
string & replace (iterator first, iterator last, const string & right);
string & replace (iterator first, iterator last, const char * ptr, size_type count);
string & replace (iterator first, iterator last, const char * ptr);
string & replace (iterator first, iterator last, size_type count, char ch);
string & replace<InputIterator> (iterator first, iterator last, InputIterator first2, InputIterator last2);
size_type copy (char * ptr, size_type count, size_type off = 0) const;
void swap (string & right);
void clear ();
void push_back (char ch);
Suche
size_type find (const string & right, size_type off = 0) const;
size_type find_first_of (const string & right, size_type off = 0) const;
size_type find_first_not_of (const string & right, size_type off = 0) const;
size_type rfind (const string & right, size_type off = npos) const;
size_type find_last_of (const string & right, size_type off = npos) const;
size_type find_last_not_of (const string & right, size_type off = npos) const;
size_type find (const char * ptr, size_type off, size_type count) const;
size_type find_first_of (const char * ptr, size_type off, size_type count) const;
size_type find_first_not_of (const char * ptr, size_type off, size_type count) const;
size_type rfind (const char * ptr, size_type off, size_type count = npos) const;
size_type find_last_of (const char * ptr, size_type off, size_type count = npos) const;
size_type find_last_not_of (const char * ptr, size_type off, size_type count) const;
size_type find (const char * ptr, size_type off = 0) const;
size_type find_first_of (const char * ptr, size_type off = 0) const;
size_type find_first_not_of (const char * ptr, size_type off = 0) const;
size_type rfind (const char * ptr, size_type off = npos) const;
size_type find_last_of (const char * ptr, size_type off = npos) const;
size_type find_last_not_of (const char * ptr, size_type off = npos) const;
size_type find (char ch, size_type off = 0) const;
size_type find_first_of (char ch, size_type off = 0) const;
size_type find_first_not_of (char ch, size_type off = 0) const;
size_type rfind (char ch, size_type off = npos) const;
size_type find_last_of (char ch, size_type off = npos) const;
size_type find_last_not_of (char ch, size_type off = npos) const;
Beobachtung
allocator_type get_allocator () const;
string substr (size_type off = 0, size_type count = npos) const;
Operationen
int compare (const string & right) const;
int compare (const char * ptr) const;
int compare (size_type off, size_type n0, const string & right) const;
int compare (size_type off, size_type n0, const string & right, size_type roff, size_type count) const;
int compare (size_type off, size_type n0, const char * ptr) const;
int compare (size_type off, size_type n0, const char * ptr, size_type off) const;