CHString::SpanExcluding 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 SpanExcluding method extracts and returns all characters preceding the first occurrence of a character from lpszCharSet.

Syntax


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

Parameters

lpszCharSet

A string interpreted as a set of characters.

Return value

The SpanExcluding method returns a substring that begins with the first character in the string and ends with the first character found in the string that is also in lpszCharSet.

If no character in lpszCharSet is found in the string, the method returns the entire string.

Examples

The following code example returns the first portion of the src parameter:


// Portions are delimited by a semi-colon( ; ),
//  a comma( , ), a period( . ), a dash( - ),
// or a colon( : ).

CHString GetFirstPart( CHString src )
{
    return src.SpanExcluding( L";,.-:" );
}

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::SpanIncluding

 

 

Show: