String::Length Method

0 out of 1 rated this helpful - Rate this topic

Retrieves the number of characters in the current String object.


    unsigned int Length()

The number of characters in the current String object.

The length of a String with no characters is zero. The length of the following string is 5:

String^ str = "Hello";

The character array returned by the String::Data Method has one additional character, which is the terminating NULL or ‘\0’. This character is also two bytes long.

Minimum supported client: Windows 8

Minimum supported server: Windows Server 2012

Namespace: Platform

Metadata: vccorlib.h

Did you find this helpful?
(1500 characters remaining)
© 2013 Microsoft. All rights reserved.