Microsoft Foundation Classes (mfc.hlp) (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
CString::Mid
CString                                     Up Contents Index Back
──Microsoft Foundation Classes──────────────────────────────────────────────
 
  CString Mid( int nFirst ) const
  throw( CMemoryException );
  CString Mid( int nFirst, int nCount ) const
  throw( CMemoryException );
 
  Parameter   Description
 
  <nFirst>    The zero-based index of the first character in this CString
              object that is to be included in the extracted substring.
 
  <nCount>    The number of characters to extract from this CString
              object. If this parameter is not supplied, then the
              remainder of the string is extracted.
 
  Remarks
 
  Extracts a substring of length <nCount> characters from this CString
  object, starting at position <nFirst> (zero-based). The function returns
  a copy of the extracted substring.
 
  Mid is similar to the Basic MID$ command (except that indexes are
  zero-based).
 
  Return Value
 
  A CString object that contains a copy of the specified range of
  characters.
 
  NOTE: The returned CString object may be empty.
 
  Example
 
  CString s( "abcdef" );
  ASSERT( s.Mid( 2, 3 ) == "cde" );
 
 
  See Also
 
  CString::Left, CString::Right
 
 
                                     -♦-