CString::SetAt

Syntax

void SetAt( int nIndex, char ch );

Parameters

nIndex

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

ch

The character to insert. Must not be '\0'.

Remarks

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.

See Also

CString::GetAt, CString::operator []