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
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see dd66cd4c-b087-415f-9c3e-94e3a1835f74.