CHString::SpanIncluding method (chstring.h)

[The CHString class is part of the WMI Provider Framework which is now considered in final state, and no further development, enhancements, or updates will be available for non-security related issues affecting these libraries. The MI APIs should be used for all new development.]

The SpanIncluding method extracts characters of a string that are identified by lpszCharSet.


CHString  throw(CHeap_Exception) SpanIncluding(
  LPCWSTR lpszCharSet



A string interpreted as a set of characters.

Return value

The SpanIncluding method returns a substring that contains characters in the string that are in lpszCharSet.

If the first character in the string is not in the specified set, the method returns an empty substring.


The SpanIncluding method starts with the first character of the string and stops when a character is found in the string but not in lpszCharSet.


The following code example shows the use of CHString::SpanIncluding.

CHString str( L"cabbage" );
CHString res = str.SpanIncluding( L"abc" );

assert( res == L"cabba" );
res = str.SpanIncluding( L"xyz" );
assert( res.IsEmpty( ) );


Requirement Value
Minimum supported client Windows Vista
Minimum supported server Windows Server 2008
Target Platform Windows
Header chstring.h (include FwCommon.h)
Library FrameDyn.lib
DLL FrameDynOS.dll; FrameDyn.dll

See also