1. Convert int, double to cstring:
Cstring STR;
Int;
Double B;
Str. Format ("% d % F", a, B );
2. Conversion from char * To cstring:
Char * s = "this is a string ";
Cstring STR = _ T (s );
3. Conversion from cstring to char:
Cstring STR = _ T ("Chinese character is also OK. ");
// Const char * s = (lpctstr) STR;
Char * s = Str. getbuffer ();
Str. releasebuffer ();
S = 0;
4. Const char * to int, double
Int I = atoi ("100 ");
Double I = atof ("100.0 ");
The cstring can be connected to the char * string by the plus sign.
Append (_ T ("APPEND string "));
Use Find (_ T ("query string, return int type "));
Insert (INT index, _ T ("insert string "));
Returns the string length with getlength;
Uses right (INT size) to extract the string with the tail length.
Use left (INT size) to intercept the header length string
Use Right, left, and find to intercept strings at specific positions.
This article from the csdn blog, reproduced please indicate the source: http://blog.csdn.net/sworderandy/archive/2007/12/26/1968181.aspx