C++,java,VB等程式语言中的字元串 string( 三 )

string的比较:
bool operator==(const string &s1,const string &s2)const;//比较两个字元串是否相等 运算符">","<",">=","<=","!="均被重载用于字元串的比较;int compare(const string &s) const;//比较当前字元串和s的大小int compare(int pos, int n,const string &s)const;//比较当前字元串从pos开始的n个字元组成的字元串与s的大小int compare(int pos, int n,const string &s,int pos2,int n2)const;//比较当前字元串从pos开始的n个字元组成的字元串与s中//pos2开始的n2个字元组成的字元串的大小int compare(const char *s) const;int compare(int pos, int n,const char *s) const;int compare(int pos, int n,const char *s, int pos2) const;//compare函式在大于(>)时返回1,小于(<)时返回-1,等于(==)时返回0string的子串:
string substr(int pos = 0,int n = npos) const;//返回pos开始的n个字元组成的字元串string的交换:
void swap(string &s2); //交换当前字元串与s2的值string类的查找函式:
int find(char c, int pos = 0) const;//从pos开始查找字元c在当前字元串的位置int find(const char *s,int pos = 0) const;//从pos开始查找字元串s在当前串中的位置int find(const char *s, int pos, int n) const;//从pos开始查找字元串s中前n个字元在当前串中的位置int find(const string &s,int pos = 0) const;//从pos开始查找字元串s在当前串中的位置 //查找成功时返回所在位置,失败返回string::npos的值int rfind(char c, int pos = npos) const;//从pos开始从后向前查找字元c在当前串中的位置int rfind(const char *s, int pos = npos) const;int rfind(const char *s, int pos, int n = npos) const;int rfind(const string &s,int pos = npos) const; //从pos开始从后向前查找字元串s中前n个字元组成的字元串在当前串中的位置,成功返回所在位置,失败时返回string::npos的值int find_first_of(char c, int pos = 0) const;//从pos开始查找字元c第一次出现的位置int find_first_of(const char *s, int pos = 0) const;int find_first_of(const char *s, int pos, int n) const;int find_first_of(const string &s,int pos = 0) const; //从pos开始查找当前串中第一个在s的前n个字元组成的数组里的字元的位置 。查找失败返回string::nposint find_first_not_of(char c, int pos = 0) const;int find_first_not_of(const char *s, int pos = 0) const;int find_first_not_of(const char *s, int pos,int n) const;int find_first_not_of(const string &s,int pos = 0) const; //从当前串中查找第一个不在串s中的字元出现的位置,失败返回string::nposint find_last_of(char c, int pos = npos) const;int find_last_of(const char *s, int pos = npos) const;int find_last_of(const char *s, int pos, int n = npos) const;int find_last_of(const string &s,int pos = npos) const;int find_last_not_of(char c, int pos = npos) const;int find_last_not_of(const char *s, int pos = npos) const;int find_last_not_of(const char *s, int pos, int n) const;int find_last_not_of(const string &s,int pos = npos) const; //find_last_of和find_last_not_of与find_first_of和find_first_not_of相似,只不过是从后向前查找 。