#pragma once #include typedef unsigned long long size_t; class nstring { public: static size_t length(const wchar_t*,int MaxCount=0); static wchar_t* clone(const wchar_t* psrc); static size_t find(const wchar_t* psrc, const wchar_t* substr,int pos = 0); static const wchar_t* str(const wchar_t* psrc, const wchar_t* substr); static wchar_t * set(wchar_t * psrc, int val); static wchar_t* cpy(wchar_t* pdest, const wchar_t* psrc); static wchar_t* ncpy(wchar_t* pdest, const wchar_t* psrc,int nlen); static char* ncpy(char* pdest, const char* psrc,int nlen); static int cmp(const wchar_t* pstr1,const wchar_t* pstr2,int MaxCount=0); static int icmp(const wchar_t* pstr1,const wchar_t* pstr2,int MaxCount=0); static wchar_t* cat(wchar_t* pdest, wchar_t* psrc,int MaxCount=0); static const wchar_t* chr(const wchar_t* psrc, int val); static int coll(const wchar_t* pstr1,const wchar_t* pstr2); static size_t cspn(const wchar_t *_Str,const wchar_t *_Control); static wchar_t * error(const wchar_t *_ErrMsg); static wchar_t * toLower(wchar_t *_Str); static wchar_t * toUpper(wchar_t *_Str); static const wchar_t * pbrk(const wchar_t *_Str,const wchar_t *_Control); static wchar_t * rev(wchar_t *_Str); static int toInt(wchar_t *_Str); static int toInt64(wchar_t* _Str); static double toDouble(wchar_t* str); static wchar_t* trim(wchar_t* str); static wchar_t* ltrim(wchar_t* str); static wchar_t* rtrim(wchar_t* str); static wchar_t* trim_(wchar_t* str,wchar_t* dest); static wchar_t* ltrim_(wchar_t* str, wchar_t* dest); static wchar_t* rtrim_(wchar_t* str, wchar_t* dest); public: static size_t length(const char*,int MaxCount=0); static char* clone(const char* psrc); static size_t find(const char* psrc, const char* substr,int pos = 0); static const char* str(const char* psrc, const char* substr); static char * set(char * psrc, int val); static char* cpy(char* pdest, const char* psrc); static int cmp(const char* pstr1,const char* pstr2,int MaxCount=0); static int icmp(const char* pstr1,const char* pstr2,int MaxCount=0); static char* cat(char* pdest, char* psrc,int MaxCount=0); static const char* chr(const char* psrc, int val); static int coll(const char* pstr1,const char* pstr2); static size_t cspn(const char *_Str,const char *_Control); static char * error(const char *_ErrMsg); static char * toLower(char *_Str); static char * toUpper(char *_Str); static const char * pbrk(const char *_Str,const char *_Control); static char * rev(char *_Str); static int toInt(char *_Str); static int toInt64(char* _Str); static double toDouble(char* str); static wchar_t * toWStr(int val); static wchar_t * toWStr(double val); static wchar_t * toWStr(int val,wchar_t* buffer, int maxLen=16); static wchar_t * toWStr(double val,wchar_t* buffer, int maxLen=31); static wchar_t* toWStr(LPARAM val); static wchar_t* toWStr(LPARAM val,wchar_t* buffer, int maxLen=31); static char* trim(char* str); static char* ltrim(char* str); static char* rtrim(char* str); };