Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

CHString::Find(WCHAR) 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 Find method searches a string for the first match of a substring.

Syntax


int Find(
   WCHAR ch
) const;

Parameters

ch

A single character that the method searches for.

Return value

If the Find method is successful, it returns the zero-based index of the first character in this CHString string that matches the requested substring or characters. If the substring or character is not found, the method returns a value of -1.

Remarks

The Find method is overloaded to accept both single characters (similar to the runtime function, wcschr) and strings (similar to the runtime function, wcsstr).

Examples

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


CHString s( L"abcdef" );
assert( s.Find( 'c' ) == 2 );
assert( s.Find( L"de" ) == 3 );

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::ReverseFind
CHString::FindOneOf

 

 

Show: