Share via


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)

Syntax

'Declaration
Public ReadOnly Property Length As Integer
public int Length { get; }
public:
property int Length {
    int get ();
}
member Length : int with get
function get Length () : int

Property Value

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

Remarks

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.

.NET Framework Security

See Also

Reference

String Class

System Namespace