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,==时返回0
string的子串:
string substr(int pos = 0,int n = npos) const;//返回pos开始的n个字符组成的字符串
string的交换:
void swap(string &s2);??? //交换当前字符串与s2的值
《string的比较》上有27条评论
评论已关闭。
Thanks a lot! I value this! canadian pharcharmy onlinecanadian online pharmacy
Effectively expressed indeed! ! canada pharmacies online prescriptions
Tips clearly used!! online doctor prescription for viagra
You actually reported this perfectly. finasteride
Whoa many of useful facts. doxycycline mono 100mg cap
You actually expressed that superbly! Drug Provigil Side Effects
Many thanks! Quite a lot of write ups.
Kamagra Oral Jelly Gel 100 Mg Viagra Generika