Collapse AllExpand All      Code: All Code: Multiple Code: Visual Basic Code: C# Code: Visual C++ Code: F# Code: JScript 
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 ReadOnly Property Length As Integer
public int Length { get; }
property int Length {
	int get ();
member Length : int
function get Length () : int

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.

.NET Framework Security