CHString::SpanIncluding method

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

Syntax


void SpanIncluding(
   LPCWSTR lpszCharSet
) const throw (CHeap_Exception);

Parameters

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.

Remarks

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.

Examples

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( ) );

Requirements

Minimum supported client

Windows Vista

Minimum supported server

Windows Server 2008

Header

ChString.h (include FwCommon.h)

Library

FrameDyn.lib

DLL

FrameDynOS.dll;
FrameDyn.dll

See also

CHString
CHString::SpanExcluding
CHString::IsEmpty

 

 

Show: