#include<iostream>
#include<cstring>
using namespace std;
class String{
private:
char *pstr;
public:
String(const char *str=" ")
{
pstr=new char[strlen(str)+1];
strcpy(pstr,str);
}
String(const String&s){// 复制构造函数
pstr=new char[strlen(s.pstr)+1];
strcpy(pstr,s.pstr);
}
void show(){
cout<<pstr<<endl;
}
friend ostream&operator<<(ostream &os,String&s);// 重 载 输 出 运 算 符 <<
1
friend istream&operator>>(istream &is,String&s);
String &operator=(String &s);// 重 载 赋 值 运 算 符
3
int length(){return strlen(pstr);}// 获 取 字 符 串 的 长 度
4
String &operator+(String &s);// 重载 +运算符连接
String &operator+=(const String &s);// 把字符串 s 连接到当前字符串的结尾
char &operator[](int n);
bool isempty(){return length()==0?true:false;}; // 当前字符串是否为空
friend bool operator==(const String &s1,const String &s2);// 比较两个字符串是否相等
bool operator>(const String&s);
bool operator<(const String&s);
bool operator>=(const String&s);
bool operator<=(const String&s);
bool operator!=(const String&s);
String &Toupper();// 将小写化为大写
String &Tolpper();// 大写变小写
int find_first_of(char c);// 从前向后查找 c 出现的第一个位置
int find_last_of(char c);// 从后向前查找 c 出现的第一个位置
int find_s_first_of(const char *s);// 从前向后查找字符串 s 第一次出现的位置
int find_s_last_of(const char *s);// 从后向前查找字符串 s 第一次出现的位置
int find(char s,int pos);// 从 pos 开始查找字符 c 在字符串中的位置