CString::GetLength

int GetLength( ) const;

Return Value

A count of the bytes in the string.

Remarks

Call this member function to get a count of the bytes in this CString object. The count does not include a null terminator.

For multibyte character sets (MBCS), GetLength counts each 8-bit character; that is, a lead and trail byte in one multibyte character are counted as two bytes.

Example

The following example demonstrates the use of CString::GetLength.

// example for CString::GetLength
CString s( "abcdef" );
ASSERT( s.GetLength() == 6 );

CString OverviewClass MembersHierarchy Chart

See Also   CString::IsEmpty