C++: string class

[Needs MUCH more -- this is just the very beginning]

string methods

TypeMethodDescription
const char*s.c_str() Returns the equivalent c-string.
int s.find(c)Returns position of leftmost occurrence of char c.
int s.length() Returns the length of the string.
int s.size() Same as s.length()???
string s.substr(start, len)s[start..start+len-1].
int s.find(s2) xxx
int s.rfind(s2) xxx
int s.find_first_of(s2) xxx
int s.find_first_not_of(s2) xxx
int s.find_last_of(s2) xxx
int s.find_last_not_of(s2) xxx
int s.find(s2) xxx
void s.assign(s2, start, len) Assigns s2[start..start+len-1] to s.
int s.compare(s2) <0, 0, or >0 as s compares to s2.
int s.compare(start1, len1, s2, start2, len2) Compares s[start1..start1+len1-1] to s2[start2..start2+len2-1].
And lots more: replace, insert, capacity, resize, iterators, string streams, ...

Overloaded operators

[] = >> << == > < >= <= !=

string streams