Extracts a substring of length nCount characters from this CStringT object, starting at position iFirst (zero-based).
The zero-based index of the first character in this CStringT object that is to be included in the extracted substring.
The number of characters to extract from this CStringT object. If this parameter is not supplied, then the remainder of the string is extracted.
A CStringT object that contains a copy of the specified range of characters. Note that the returned CStringT object may be empty.
The function returns a copy of the extracted substring. Mid is similar to the Basic Mid function (except that indexes in Basic are one-based).
For multibyte character sets (MBCS), nCount refers to each 8-bit character; that is, a lead and trail byte in one multibyte character are counted as two characters.
// typedef CStringT<TCHAR, StrTraitATL<TCHAR, ChTraitsCRT<TCHAR>>> CAtlString;
ASSERT(s.Mid(2, 3) == _T("cde"));
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback