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


CStringT::Remove

Removes all instances of the specified character from the string.

int Remove(
   XCHAR chRemove
);

Параметры

  • chRemove
    The character to be removed from a string.

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

The count of characters removed from the string. Zero if the string is not changed.

Заметки

Comparisons for the character are case sensitive.

Пример

// typedef CStringT<TCHAR, StrTraitATL<TCHAR, ChTraitsCRT<TCHAR>>> CAtlString;

CAtlString str(_T("This is a test."));
int n = str.Remove(_T('t'));
ASSERT(n == 2);
ASSERT(str == _T("This is a es."));   

Требования

Header: cstringt.h

См. также

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

CStringT Class

CStringT Members