Platform SDK: Windows Management Instrumentation

CHString::FindOneOf

The FindOneOf method searches a string for the first character that matches any character contained in lpszCharSet.

int FindOneOf(
  LPCWSTR lpszCharSet ) const;

Parameters

lpszCharSet
String containing characters used in the matching operation.

Return Values

If the method is successful, it returns the zero-based index of the first character in the string that is also in lpszCharSet. If there is no match, the method returns a value of -1.

Example

The following example demonstrates the use of CHString::FindOneOf:

CHString s( L"abcdef" );
assert( s.FindOneOf( L"xd" ) == 3 ); // 'd' is first match

Requirements

  Windows NT/2000: Requires Windows NT 4.0 SP4 or later.
  Windows 95/98: Requires Windows 95 OSR2 or later.
  Header: Declared in Chstring.h.
  Library: Use Framedyn.lib.

See Also

CHString::Find