Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All


Visual Studio 6.0


void SetAt( int nIndex, TCHAR ch );



Zero-based index of the character in the CString object. The nIndex parameter must be greater than or equal to 0 and less than the value returned by GetLength. The Debug version of the Microsoft Foundation Class Library will validate the bounds of nIndex; the Release version will not.


The character to insert.


You can think of a CString object as an array of characters. The SetAt member function overwrites a single character specified by an index number. SetAt will not enlarge the string if the index exceeds the bounds of the existing string.

CString OverviewClass MembersHierarchy Chart

See Also   CString::GetAt, CString::operator [ ]

© 2015 Microsoft