CString::GetLength Home
 
CString::GetLength

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

© 2009 Microsoft Corporation. All rights reserved.   Terms of Use | Trademarks | Privacy Statement
Page view tracker
Rate the Lightweight library
x
Lightweight builds on ScriptFree (loband) by adding features you've requested: a SearchBox and default code language selection.
Do you like the SearchBox?
Do you like the tabbed code blocks?
How useful is this topic?
Tell us more.
Thanks
x
You're helping to improve MSDN Online.
Feedback
Switch View
Classic
Lightweight Beta
ScriptFree
Switch View