Поделиться через


CSimpleStringT::SetAt

Sets a single character from a CSimpleStringT object.

void SetAt(
   int iChar,
   XCHAR ch
);

Параметры

  • 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.

Заметки

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.

Пример

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);   

Требования

Header: atlsimpstr.h

См. также

Основные понятия

CSimpleStringT Class

CSimpleStringT Members

CSimpleStringT::GetAt

CSimpleStringT::operator []