📄 stringtool.h
字号:
#pragma once
class StringTool
{
private:
/*pSrc是否以pTarget开头*/
static bool BeginWith(const char* pSrc,char* pTraget,int lowUp=0);
public:
static int ERROR;
static int SUCCESS;
//7.0.441.400
/*查找字符c在pSrc中第n次出现的位置,从0开始, -1未找到*/
static int Find(const char* pSrc,char c,int n=1);
/*查找字符串pTarget在pSrc中的位置 -1未找到,lowUp -1 表示tolower,1 表示touper*/
static int Find(const char* pSrc,char* pTraget,int lowUp=0);
/*查找pSrc中index和index左的字符放到pResult*/
static int Left(const char* pSrc,char* pResult,int index);//pResult是输出参数,它在外部已分配好空间
/*查找pSrc中index和index右的字符放到pResult*/
static int Right(const char* pSrc,char* pResult,int index);
/*查找pSrc中index和index右len-1个字符放到pResult*/
static int Mid(const char* pSrc,char* pResult,int index,int len);
/*把pSrc中的rSrc替换成rMent,结果放到pResult*/
static int Replace(const char* pSrc,char* pResult,char* rSrc,char* rMent);
/*字符串变成数字*/
static float Str2Num(const char* pSrc);
static float CalculateExperssion(const char* pSrc);
/*
找),找(,得到SubExp,
找'*',找*左右的操作符,得到*的表达式,计算*法
*/
};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -