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


CSimpleStringT::GetAt

Returns a single character from a CSimpleStringT object.

XCHAR GetAt(
   int iChar
) const;

Параметры

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

Возвращаемое значение

An XCHAR containing the character at the specified position in the string.

Заметки

Call this method to return a single character specified by iChar. The overloaded subscript ([]) operator is a convenient alias for GetAt.

Пример

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

CSimpleString s(_T("abcdef"), pMgr);
ASSERT(s.GetAt(2) == _T('c'));   

Требования

Header: atlsimpstr.h

См. также

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

CSimpleStringT Class

CSimpleStringT Members

CSimpleStringT::GetLength

CSimpleStringT::operator []