Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

Length Property

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Gets the number of characters in the current String object.

Namespace:  System
Assembly:  mscorlib (in mscorlib.dll)

public int Length { get; }

Property Value

Type: System..::..Int32
The number of characters in the current string.

The Length property returns the number of Char objects in this instance, not the number of Unicode characters. The reason is that a Unicode character might be represented by more than one Char. Use the StringInfo class to work with each Unicode character instead of each Char.

Show:
© 2015 Microsoft