Platform SDK: Windows Management Instrumentation

CHString::Right

The Right method extracts the last (that is, rightmost) nCount characters from a CHString string and returns a copy of the extracted substring. If nCount exceeds the string length, then the entire string is extracted.

CHString Right( 
  int nCount ) const
throw( CHeap_Exception );

Parameters

nCount
The number of characters extracted from the CHString string.

Return Values

Returns a CHString object that contains a copy of the specified range of characters. Note that the returned CHString object can be empty.

Example

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

CHString s( L"abcdef" );
assert( s.Right(2) == L"ef" );

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::Mid, CHString::Left