CSimpleStringT::SetAt

Sets a single character from a CSimpleStringT object.

void SetAt( 
   int iChar, 
   XCHAR ch 
);

Parameters

  • iChar
    Zero-based index of the character in the CSimpleStringT object. The iChar parameter must be greater than or equal to 0 and less than the value returned by GetLength.

  • ch
    The new character.

Remarks

Call this method to overwrite the character located at iChar. This method will not enlarge the string if iChar exceeds the bounds of the existing string.

Example

The following example demonstrates the use of CSimpleStringT::SetAt.

CSimpleString s(_T("abcdef"), pMgr);

s.SetAt(1, _T('a'));
ASSERT(_tcscmp(s, _T("aacdef")) == 0);   

Requirements

Header: atlsimpstr.h

See Also

Reference

CSimpleStringT Class

CSimpleStringT::GetAt

CSimpleStringT::operator []