Partager via


CStringT::FindOneOf

Searches this string for the first character that matches any character contained in pszCharSet.

int FindOneOf(
   PCXSTR pszCharSet
) const throw( );

Parameters

  • pszCharSet
    String containing characters for matching.

Return Value

The zero-based index of the first character in this string that is also in pszCharSet; –1 if there is no match.

Remarks

Finds the first occurrence of any of the characters in pszCharSet.

Example

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

CAtlString s(_T("abcdef"));
ASSERT(s.FindOneOf(_T("xd")) == 3); // 'd' is first match   

Requirements

Header: cstringt.h

See Also

Reference

CStringT Class