CString
lastmod 2021-02-25created 2020-09-012 edits
A CString object consists of a variable-length sequence of characters. CString provides functions and operators using a syntax similar to that of Basic. Concatenation and comparison operators, together with simplified memory management, make CString objects easier to use than ordinary character arrays.
About
CString does not inherit from CObject and is one of the Simple Value Types. A CString Object consists of a variable-length sequence of characters and is easier to use than a character array. CString is based on the TCHAR data type.
The String as an Array
-
GetLength(): Returns the length of the string -
IsEmpty(): Checks whether the string buffer is empty -
Empty(): Deletes the string and empties the buffer. -
GetAt(): Gets the character at a given position. -
SetAt(): Sets the character at a given position.
Comparison
-
Compare(): Case-sensitive string comparison. -
CompareNoCase(): Case-insensitive string comparison. -
Collate(): -
CollateNoCase():
Extraction
-
Mid(): Extracts the middle part of the string. -
Left(): Extracts the left part of the string. -
Right(): Extracts the right part of the string. -
SpanIncluding(): Extracts the included characters. -
SpanExcluding(): Extracts the string of characters not included.
Other conversions
-
MakeUpper(): Converts lowercase to uppercase. -
MakeLower(): Converts uppercase to lowercase. -
MakeReverse(): Reverses the characters. -
Replace(): -
Remove(): Removes characters. -
Insert(): -
Delete(): -
Format(): Stores a formatted string. -
FormatV(): -
TrimLeft(): -
TrimRight(): -
FormatMessage():
Serching
-
Find(): Finds and returns the index of a character. -
ReverseFind(): Searches from the end. -
FindOneOf():
Buffer Access
-
GetBuffer(): -
GetBufferSetLength(): -
ReleaseBuffer(): -
FreeExtra(): -
LockBuffer(): -
UnlockBuffer():
See also
Favorite site
- [http://msdn.microsoft.com/en-us/library/aa300688(v=vs.60.aspx MSDN description of CString]
- CString string manipulation methods