📄 string.h
字号:
#ifndef _String_H
#define _String_H
#define MAX_STRING 200
#include <iostream>
class String
{
public:
String();
String(const char* astr);
String(const String& astr);
String(const char ch, int num = 1);
String(int num);
String& operator=(const String& astr);
String& operator=(const char ch);
~String();
String& operator+=(const String& astr);
bool operator==(const String& astr) const;
bool operator!=(const String& astr) const;
char getChar(int i);
bool empty() const;
int getlenth() const;
int reGetlenth();
int find(char ch) const;
String getSub(int beg, int end);
void Set(int len);
int intoInt();
double intoDouble();
operator unsigned char*();
friend std::ostream& operator<<(std::ostream& out, const String& astr);
friend std::istream& operator>>(std::istream& in, String& astr);
private:
int lenth;
unsigned char* str;
};
String operator+(const String& lstr, const String& rstr);
String intoString(int i);
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -